Javascript Reference
Categories: Number

javascript Number toFixed( )

@March 15, 2008, 1:22 a.m.
toFixed( )Firefox/Netscape/NN 6 IE 5.5(Win) ECMA 3  

toFixed(fractionDigits)

  

Returns a string containing the number object's value displayed with a fixed number of digits to the right of the decimal (useful for currency calculation results). If you specify a parameter that yields a display with fewer significant digits than the original number, the returned value is rounded, but based only on the value of the digit immediately to the right of the last displayed digit (i.e., rounding does not cascade).

 
Parameters
 
  • An integer specifying the number of digits to the right of the decimal in the returned string.
 
Returned Value

String.


Powered by Linode.