lib/standard/string: Removed Float.to_precision_native
authorLucas Bajolet <r4pass@hotmail.com>
Tue, 3 Feb 2015 20:53:01 +0000 (15:53 -0500)
committerLucas Bajolet <r4pass@hotmail.com>
Thu, 5 Feb 2015 16:08:57 +0000 (11:08 -0500)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

lib/standard/string.nit

index 2488f2e..7836bf1 100644 (file)
@@ -2018,23 +2018,6 @@ redef class Float
 
                return p1 + "." + p2
        end
-
-       # `self` representation with `nb` digits after the '.'.
-       #
-       #     assert 12.345.to_precision_native(1) == "12.3"
-       #     assert 12.345.to_precision_native(2) == "12.35"
-       #     assert 12.345.to_precision_native(3) == "12.345"
-       #     assert 12.345.to_precision_native(4) == "12.3450"
-       fun to_precision_native(nb: Int): String import NativeString.to_s `{
-               int size;
-               char *str;
-
-               size = snprintf(NULL, 0, "%.*f", (int)nb, recv);
-               str = malloc(size + 1);
-               sprintf(str, "%.*f", (int)nb, recv );
-
-               return NativeString_to_s( str );
-       `}
 end
 
 redef class Char