formatting numerical output in a human-friendly style. The
methods enable numbers to be output as floating point values or powers
of 10 with a specified width and number of figures after the decimal
integer values, or to attach a leading zero to single digit numbers.
The object and methods are included in the
section of this document with a link to a more complete
Check these examples to see how to use the formatting functions
and as a test to see if they function correctly on your browser; tested in most modern browsers.
To insert leading zero for integers 0-9. No change will take
place for integers > 9.
Tests for the
functions, where w is the width of the field and d is the
number of figures after the decimal point. The result is rounded either up or down to be
correct to the number of digits requested. The result is aligned to the right of the field.
The default padding character is a space " ".
View the source...
This script formats field entry if it is numeric.