Functiondojo.number._applyPattern

dojo.require("dojo.number");
defined in dojo/number.js

Apply pattern to format value as a string using options. Gives no consideration to local customs.

Usage

function (/*Number*/ value, /*String*/ pattern, /*dojo.number.__FormatOptions?*/ options) (view source)
parametertypedescription
valueNumberthe number to be formatted.
patternStringa pattern string as described by [unicode.org TR35](http://www.unicode.org/reports/tr35/#Number_Format_Patterns)
optionsdojo.number.__FormatOptionsOptional. _applyPattern is usually called via `dojo.number.format()` which populates an extra property in the options parameter, "customs". The customs object specifies group and decimal parameters if set.
fieldtypedescription
.currencyStringOptional. an [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code, a three letter sequence like "USD"
.localeStringOptional. override the locale used to determine formatting rules
.patternStringOptional. override [formatting pattern](http://www.unicode.org/reports/tr35/#Number_Format_Patterns) with this string
.placesNumberOptional. fixed number of decimal places to show. This overrides any information in the provided pattern.
.roundNumberOptional. 5 rounds to nearest .5; 0 rounds to nearest whole (default). -1 means don't round.
.symbolStringOptional. localized currency symbol
.typeStringOptional. choose a format type based on the locale from the following: decimal, scientific, percent, currency. decimal by default.