Format Value
The Value Formatting system automatically formats numeric values to fit within their containers while maintaining readability. It supports various formatting options including abbreviations (K, M, B), dynamic precision adjustment, and currency values with proper symbol placement.
Basic Usage
To enable automatic value formatting, add the data-value-format="true"
attribute to your element.
<span class="value value--xlarge value--tnums" data-value-format="true">2345678</span>
<span class="value value--large value--tnums" data-value-format="true">456789</span>
<span class="value value--small value--tnums" data-value-format="true">34562</span>
To add a delimiter to large numbers, for example 1234 => 1,234, see custom filters.
Currency Values
Values with currency symbols are automatically formatted while maintaining the symbol placement.
<span class="value value--xlarge value--tnums" data-value-format="true" data-fit-value="true">$2345678</span>
<span class="value value--large value--tnums" data-value-format="true" data-fit-value="true">$456789</span>
<span class="value value--small value--tnums" data-value-format="true" data-fit-value="true">$34562</span>
To add a currency symbol, for example 1234 => $1,234, see custom filters.
Supported currency symbols include:
$
US Dollar
€
Euro
£
British Pound
¥
Japanese Yen / Chinese Yuan
₴
Ukrainian Hryvnia
₹
Indian Rupee
₪
Israeli Shekel
₩
Korean Won
₫
Vietnamese Dong
₱
Philippine Peso
₽
Russian Ruble
₿
Bitcoin
Regional Number Formats
Numbers can be formatted according to different regional standards using the data-value-locale
attribute.
<span class="value value--xlarge value--tnums" data-value-format="true" data-value-locale="en-US">$123456.78</span>
<span class="value value--large value--tnums" data-value-format="true" data-value-locale="de-DE">€123456.78</span>
<span class="value value--small value--tnums" data-value-format="true" data-value-locale="fr-FR">€123456.78</span>
Common locale options include:
en-US
United States (123,456.78)
de-DE
German (123.456,78)
fr-FR
French (123 456,78)
en-GB
British English (123,456.78)
ja-JP
Japanese (123,456.78)
If no locale is specified, numbers will be formatted using US format (en-US) by default.