September 9, 2000 - Trimming Decimal Numbers

Until IE5.5, formatting numbers was a real challenge. We all used high mathematical functions such as Math.ceil and Math.pow to format numbers the way we wanted to. IE5.5 fixes this problem with three new methods of the Number prototype object:

toFixed(fractionDigits)

toExponential(fractionDigits)

toPrecision(precision)

The toFixed(fractionDigits) method formats a number with fractionDigits digits after the decimal place. If, for example,