Bookshelf Home | Contents | Index | PDF |
Siebel eScript Language Reference > Siebel eScript Commands > Conversion Methods > toFixed() MethodThis function returns a number converted to a specified number of decimal places. SyntaxReturnsThis function returns the number contained in variable numberVar, expressed to len decimal places. If len is less than the number of significant decimal places of numberVar, then the function applies standard rounding (round up for 5 or greater, else round down). If len is greater than the number of significant decimal places of numberVar, then the function pads the extra places with zeroes. If len is negative, an error is thrown. UsageThis function allows you to express numbers with a desired number of decimal places; for example, to express results of currency calculations with exactly two decimal places. ExampleThe following uses of toFixed() yield the results shown. var profits=2487.8235 See Also |
Siebel eScript Language Reference |