dojo.number.format
dojo.require("dojo.number");
defined in dojo/number.js
Create a string from a Number using a known localized pattern.
Formatting patterns appropriate to the locale are chosen from the
CLDR as well as the appropriate symbols and
delimiters. See
parameter | type | description |
---|
value | Number | the number to be formatted. If not a valid JavaScript number, return null. |
options | dojo.number.__FormatOptions | Optional. field | type | description |
---|
.currency | String | Optional. an [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code, a three letter sequence like "USD" | .locale | String | Optional. override the locale used to determine formatting rules | .pattern | String | Optional. override [formatting pattern](http://www.unicode.org/reports/tr35/#Number_Format_Patterns) with this string | .places | Number | Optional. fixed number of decimal places to show. This overrides any information in the provided pattern. | .round | Number | Optional. 5 rounds to nearest .5; 0 rounds to nearest whole (default). -1 means don't round. | .symbol | String | Optional. localized currency symbol | .type | String | Optional. choose a format type based on the locale from the following: decimal, scientific, percent, currency. decimal by default. |
|