Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><code>toString()</code> internally calls <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Float.html#toString%28float%29" rel="nofollow"><strong>toString(float)</strong></a> This is what the documentation says for <code>toString(float)</code> </p> <blockquote> <p>Otherwise, the result is a string that represents the sign and magnitude (absolute value) of the argument. If the sign is negative, the first character of the result is '-' ('\u002D'); if the sign is positive, no sign character appears in the result. As for the magnitude m:</p> <ul> <li><p>If m is greater than or equal to 10-3 but less than 107, then it is represented as the integer part of m, in decimal form with no leading zeroes, followed by '.' ('\u002E'), followed by one or more decimal digits representing the fractional part of m.</p></li> <li><p>If m is less than 10-3 or greater than or equal to 107, ** Let n be the unique integer such that 10n ≤ m &lt; 10n+1; then let a be the mathematically exact quotient of m and 10n so that 1 ≤ a &lt; 10. The magnitude is then represented as the integer part of a, as a single decimal digit, followed by '.' ('\u002E'), followed by decimal digits representing the fractional part of a, followed by the letter 'E' ('\u0045'), followed by a representation of n as a decimal integer, as produced by the method Integer.toString(int).</p></li> </ul> <p><strong>To create localized string representations of a floating-point value, use subclasses of NumberFormat.</strong></p> </blockquote> <p>Hope this helps you understand <code>WHY</code> and <code>HOW</code> to fix it i.e. use <code>DecimalFormat</code> as you have mentioned inside your field factory and return as string representation for display purpose.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload