Bookshelf Home | Contents | Index | PDF |
Siebel eScript Language Reference > Siebel eScript Commands > Conversion Methods > toPrecision() MethodThis function returns a number converted to a specified number of significant digits. Syntax
ReturnsThis function returns the number contained in variable numberVar, expressed to len significant digits. If len is less than the number of significant digits of numberVar, then the function applies standard rounding (round up for 5 or greater, else round down) and expression in scientific notation, if necessary. If len is greater than the number of significant decimal places of numberVar, then the function pads the extra digits with zeroes and adds a decimal point, if necessary. UsageThis function allows you to express numbers at a desired length; for example, the result of a scientific calculation may only justify accuracy to a specific number of significant digits. ExampleThe following uses of toPrecision() yield the results shown. var anumber = 123.45 See Also |
Siebel eScript Language Reference |