Formats the value of a dollar amount rounding the number to two decimal places.
JSV_dollarFormat(expD)
expD.dollarFormat()
The dollarFormat function returns the string representation of a dollar amount rounding the number to two decimal places. If the value is negative, then the returned formatted dollar value is positive and enclosed in parentheses.
The dollarFormat function uses the following arguments.
Argument | Description |
expD | The dollar amount that is to be formatted. |
n/a
The following lines of code
var f = -32.9876;
document.write( "The dollar amount " + f +
" is formatted as " +
JSV_dollarFormat(f) );
var f = -1.4786;
document.write( "The dollar amount " + f +
" is formatted as " +
JSV_dollarFormat(f) );
produce
Copyright © 1999-2000 Roaring Fork Software. All rights reserved.