You can set a number or date formatting for tooltip contents using “{keyword:#,##0.00}”. Data field names can be used in tooltips, charts, maps, and other similar controls that share the same structure using “[FieldName:#,##0.00]”. A list of available formatting options is given below:
- [Anything] : Label information will be displayed inside the brackets, where ‘Anything’ label is entered. This can be used for currency formatting. (i.e. [$]#,##0.00)
- #,## : Adds a comma separator. This keyword also requires adding “0” or “0.x” to the end (i.e. #,##0.00).
- 0 : The number will be rounded to the nearest whole number.
- 0.0 : The number will be rounded to one decimal place. More zeroes added to the right means more decimal places allowed. (i.e. 0.000 means 3 numbers after the decimal)
- s : Adds SI-prefix to numbers. (i.e. a format like #,##0.00s will be displayed as 45M with a value of 45150000. Adding one more zero before the ‘s’ will give 45.1M.)
- % : Converts the number into a percentage. This works like the “s” keyword. The values will be multiplied by 100.
- AM/PM: Adds 12-hour clock format.
- YYYY: Adds full year.
- YY: Adds last two digits of the year.
- mmmm: Adds full month name.
- mmm: Adds abbreviated month name.
- mm: Adds month as a decimal number. (i.e. 01, 12]
- dddd: Adds full weekday name.
- ddd: Adds abbreviated weekday name.
- dd: Adds weekday as a decimal number. (i.e. 01, 12]
- HH: Adds hours as a decimal number.
- MM: Adds minutes as a decimal number.
- SS: Adds seconds as a decimal number.
Single Named Ranges
Upon opening the curly brackets, you will note a list of Single Named Ranges (SNR). Selecting one of these from the hints will populate the content control with the named range’s name.
If you would like no formatting to be applied, you can simply close the two brackets and the value will be injected as an unformatted value.
Alternatively, several formatting options are available when injecting the value of a Single Named Range (SNR). To utilize any of the formatting options, simply type in a colon character (:) after the named range’s name to see a list of supported data types.
These data types (Integer, Decimal, DateTime or Text) are necessary for the determination of the actual format, so select one that fits the assumed value of the Single Named Range (SNR). Text data type is different from the others since it will get the formatted value directly from the PSC. Text data type has an optional paramater None for format which has no effect on the output.
Upon selecting the data type, add an additional semicolon character (;) to begin defining the desired format for the output value. The .NET formatting standards apply to this format and are outlined below.
- Standard Numeric Formatting
- Custom Numeric Formatting
- Standard Date and Time Formatting
- Custom Date and Time Formatting
See below for some examples.
{{NamedRangeName:Decimal;C2}}
- When
NamedRangeName = 12, the formatted value will be$12.00. - When
NamedRangeName = 1.2345561, the formatted value will appear$1.23. - When
NamedRangeName = 'ABC', the formatted value will appear blank.
{{NamedRangeName:Decimal;P3}}
- When
NamedRangeName = 0.12, the formatted value will be12.000%. - When
NamedRangeName = 1.2345561, the formatted value will appear123.457%. - When
NamedRangeName = 'ABC', the formatted value will appear blank.
{{NamedRangeName:Decimal;00000}}
- When
NamedRangeName = 1234.5678, the formatted value will be01235. - When
NamedRangeName = 1.2345561, the formatted value will appear00001. - When
NamedRangeName = 'ABC', the formatted value will appear blank.
Predefined Formats
In addition to manual format setting you may also use one of the predefined Numeric or Date and Time Formatting:
Integer (Input value: 1234)
{{ValueInteger:Integer;00}}=> 1234{{ValueInteger:Integer;#,##0}}=> 1,234{{ValueInteger:Integer;00000}}=> 01234{{ValueInteger:Integer;##-##}}=> 12-34
Decimal (Input value: 123456.78)
{{ValueDecimal:Decimal;0.0}}=> 123456.8{{ValueDecimal:Decimal;0.00}}=> 123456.78{{ValueDecimal:Decimal;#,##0.0}}=> 123,456.8{{ValueDecimal:Decimal;#,##0.00}}=> 123,456.78{{ValueDecimal:Decimal;0.##}}=> 123456.78{{ValueDecimal:Decimal;00.00}}=> 123456.78{{ValueDecimal:Decimal;0,0.00}}=> 123,456.78{{ValueDecimal:Decimal;0%}}=> 12345678%{{ValueDecimal:Decimal;0.0%}}=> 12345678.0%
Datetime (Input value: 12/05/2018 11:25:07 pm)
{{NamedRangeName:Datetime;yyyy}}=> 2018{{NamedRangeName:Datetime;MM}}=> 12{{NamedRangeName:Datetime;dd}}=> 05{{NamedRangeName:Datetime;yyyy/MM/dd}}=> 2018/12/05{{NamedRangeName:Datetime;MM/dd/yyyy}}=> 12/05/2018{{NamedRangeName:Datetime;dd/MM/yyyy}}=> 05/12/2018{{NamedRangeName:Datetime;HH}}=> 23{{NamedRangeName:Datetime;mm}}=> 25{{NamedRangeName:Datetime;ss}}=> 07{{NamedRangeName:Datetime;tt}}=> PM{{NamedRangeName:Datetime;HH:mm tt}}=> 23:25 PM{{NamedRangeName:Datetime;HH:mm:ss tt}}=> 23:25:07 PM
Text
{{NamedRangeName:Text;None}}: None is an optional parameter{{NamedRangeName:Text}}: Will work the same as above
List and Table Named Ranges
These types of named ranges are entered in the same format as Single Named Ranges (SNR), except they do not support formatting of the output values. Using a List or Table Named Range within two sets of curly brackets will inject a full table into the content / label control.
This is best utilized when looking to test the values that exist within a named range, rather than for final presentation of a list or table named range. To present a readable and customizable format, utilize an Input or Output Grid control to display this type of data.