Siebel eScript Language Reference > Methods Reference > Conversion Methods >

Convert Number to Fixed Decimal Method


The Convert Number to Fixed Decimal method converts a number according to the decimal places that you specify. It returns the number that it converts. It allows you to express a number that includes a number of decimal places that you specify. For example, to express the results of a currency calculation that includes two decimal places.

This method does the same work as the Convert Number to Exponential Notation method. For more information, see How the Convert Number to Exponential Notation Method Handles the Len Argument.

This method uses the same argument as the Convert Number to Exponential Notation method. For more information, see Table 87.

Format

numberVar.toFixed(len)

Example

The following example uses the Convert Number to Fixed Decimal method:

var profits=2487.8235
var profits3 = profits.toFixed(3) //returns 2487.824
var profits2 = profits.toFixed(2) //returns 2487.82
var profits7 = profits.toFixed(7) //returns 2487.8235000
var profits0 = profits.toFixed(0) //returns 2488
var profitserr = profits.toFixed(-1) //throws error

Siebel eScript Language Reference Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices.