Formatting Numbers
It is common to want to format integer and real entities for display in table columns - for example to display them as currency or percentage values.
This is straightforward using the
format attribute on
<vdl-table-column> elements. This attribute takes a string representing the format to apply.
In addition to the symbols described above, you can add any arbitrary text, such as a currency symbol.
Format String Component | Meaning |
---|---|
0 | Digit |
# | Digit, zero shows as absent |
. | Decimal separator |
- | Negative sign |
, | Grouping separator |
% | Percent - multiplies number by 100 |
<vdl-table> <vdl-table-column entity="Costs" format="$#,###.00"> </vdl-table-column> <vdl-table>