Locale FormatNumberCustom using Standard Patterns Example

The following example demonstrates the use of the standard numeric format strings.

Smartsite SXML CopyCode image Copy Code
Currency: {locale.formatnumbercustom(104.2, c)} = 104.20<br />
Decimal: {locale.formatnumbercustom(10, d4)} = 0010<br/>
Scientific: {locale.formatnumbercustom(10, e3)} = 1.000e+001<br/>
Fixed-point: {locale.formatnumbercustom(3.1415, f2)} = 3.14<br/>
General: {locale.formatnumbercustom(10, g)} = 10<br/>
Number: {locale.formatnumbercustom(10, n2)} = 10.00<br/>
Percent: {locale.formatnumbercustom(0.1, p)} = 10.00 %<br/>
Hexadecimal: {locale.formatnumbercustom(1234, X)} = 4D2<br/>
Example Result CopyCode image Copy Code
Currency: $104.20 = 104.20<br />
Decimal: 0010 = 0010<br />
Scientific: 1.000e+001 = 1.000e+001<br />
Fixed-point: 3.14 = 3.14<br />
General: 10 = 10<br />
Number: 10.00 = 10.00<br />
Percent: 10.00 % = 10.00 %<br />
Hexadecimal: 4D2 = 4D2<br />