Fixed FloatMath.toString(), added tests.

This commit is contained in:
Michael Bayne
2011-07-29 11:00:20 -07:00
parent 92f6e0932f
commit 1936e20380
2 changed files with 36 additions and 1 deletions
+5 -1
View File
@@ -388,7 +388,11 @@ public class FloatMath
public static String toString (float value)
{
StringBuilder buf = new StringBuilder();
buf.append(value >= 0 ? "+" : "-");
if (value >= 0) buf.append("+");
else {
buf.append("-");
value = -value;
}
int ivalue = (int)value;
buf.append(ivalue);
if (TO_STRING_DECIMAL_PLACES > 0) {