Number Mask Options

Root > 3. Customisation

Number Mask Options


When using either < #INPUT or <#FIELD tags you can change the display of the data to use a number format. To adjust the data as numbers use format=number. You can further modify the data by using a mask= parameter. An example would be-

<#INPUT field=1001 format=number mask="$#,###.00">.

There are two compatible sets of mask= parameters. The first is a more visual approach.
Use #,###.00 where 0 represents a place holder, # is a number (unless blank), and everything else is literal. A period decimal point means to use a decimal point. A comma means to use a thousands separator. Using format=number mask="#,###.00" would format the following data as-
 
0.3 = .30
1.5 = 1.50
1.55 = 1.55
1000 = 1,000.00
 
You may also use additional symbols like $. You can use scientific notation. You may also use separate formats for +/- and 0 by using a semi-colon (;) between the masks.
 
The second approach can be more complex. Use "%" [index ":"] ["-"] [width] ["." prec] where the format begins with a %, followed by an optional index ":", an optional left justifier indicator "-", an optional width specifier, an optional precision indicator ".", and the type, which can be d for Decimal, u for Unsigned, e for Scientific, f for Fixed, g for General, n for Number, m for Money, x for Hex. Using format=number mask="%8.2f" would produce results that are like

123.45
45.01
and 89778.00


Regional details are also available at http://www.wiredcontact.co.uk

Add Feedback