Formatting
Localization involves more than just translation—it ensures that data formats align with the user's locale and cultural preferences. @localizer provides a robust suite of data formatters designed to handle a wide range of common use cases.
To learn more about the core concepts and functionality of value formatters, refer to the Introduction section of this guide.
Numbers and amounts
@localizer/format 1.1.3
€1,005.00
Formats monetary amounts with a specified currency.€1,005.00
@localizer/format-number 1.1.3
€21M
Configurable formatter for monetary amounts with currency.€21M
@localizer/format 1.1.3
1,234,567.89
Formats generic numbers.1,234,567.89
@localizer/format-number 1.1.3
1.2 million
Configurable formatter for generic numbers.1.2 million
@localizer/format 1.1.3
1,000–2,000
Formats generic number ranges.1,000–2,000
@localizer/format-number 1.1.3
1–2 thousand
Configurable formatter for generic number ranges.1–2 thousand
@localizer/format-number 1.1.3
€21M
Configurable formatter for monetary amounts with a fixed currency.€21M
@localizer/format-number 1.1.3
€1–1.5K
Configurable formatter for monetary ranges with a fixed currency.€1–1.5K
@localizer/format-number 1.1.3
1.4MB
Configurable formatter for measurement values with a predefined unit.1.4MB
@localizer/format-number 1.1.3
1.2M – 1.4MB
Configurable formatter for measurement value ranges with a predefined unit.1.2M – 1.4MB
@localizer/format 1.1.3
146%
Formats percentage ratios.146%
@localizer/format-number 1.1.3
146.00%
Configurable formatter for percentage ratios.146.00%
@localizer/format 1.1.3
10% – 20%
Formats percentage ratio ranges.10% – 20%
@localizer/format-number 1.1.3
10.00% – 20.00%
Configurable formatter for percentage ratio ranges.10.00% – 20.00%
@localizer/format-number 1.1.3
+€1.5K
Configurable formatter for absolute monetary changes with a predefined currency.+€1.5K
@localizer/format 1.1.3
+15
Formats absolute changes in unitless amounts.+15
@localizer/format-number 1.1.3
+1.5 thousand
Configurable formatter for absolute changes in unitless amounts.+1.5 thousand
@localizer/format 1.1.3
+43%
Calculates the relative change between two values and formats it as a percentage.+43%
@localizer/format-number 1.1.3
+42.86%
Configurable formatter for relative changes between two values as a percentage.+42.86%
@localizer/format-number 1.1.3
+1.5Kg
Configurable formatter for absolute changes in measurement values with a predefined unit.+1.5Kg
@localizer/format 1.1.3
120 km/h
Formats measurement values with units.120 km/h
@localizer/format-number 1.1.3
120 kilometers per hour
Configurable formatter for measurement values with units.120 kilometers per hour
Dates and times
@localizer/format 1.1.3
3/23/2025
Formats date.3/23/2025
@localizer/format 1.1.3
2/15/2022 – 3/23/2025
Formats date ranges.2/15/2022 – 3/23/2025
@localizer/format 1.1.3
3/23/2025, 11:59:00 AM
Formats date/time.3/23/2025, 11:59:00 AM
@localizer/format-datetime 1.1.3
Sunday, March 23 at 11:59 AM
Configurable formatter for dates and times.Sunday, March 23 at 11:59 AM
@localizer/format 1.1.3
3/23/2025, 11:40:35 AM – 11:59:00 AM
Formats date/time ranges.3/23/2025, 11:40:35 AM – 11:59:00 AM
@localizer/format-datetime 1.1.3
Mar 23, 2025, 11:40 – 11:59 AM
Configurable formatter for date and time ranges.Mar 23, 2025, 11:40 – 11:59 AM
@localizer/format 1.1.3
18 minutes ago
Formats relative moments in the past or future.18 minutes ago
@localizer/format-relativetime 1.1.3
today
Configurable formatter for relative moments in the past or the future.today
@localizer/format 1.1.3
11:59:00 AM
Formats time.11:59:00 AM
Strings and enumerations
@localizer/format 1.1.3
United States
Formats country names.United States
@localizer/format-number 1.1.3
British pounds
Configurable formatter for currency names or symbols.British pounds
@localizer/format 1.1.3
British Pound
Formats currency names.British Pound
@localizer/format 1.1.3
£
Formats currency symbols.£
@localizer/format-displayname 1.1.3
US
Configurable formatter for country, language, and currency names.US
@localizer/format 1.1.3
Swedish (Finland)
Formats language or locale names.Swedish (Finland)
Other types
@localizer/format 1.1.3
A, B, C, and D
Formats lists by joining elements with "and".A, B, C, and D
@localizer/format 1.1.3
Automatic formatting
Formats values according to their type.Automatic formatting
@localizer/format 1.1.3
A, B, C, D
Formats lists by joining elements with a locale-specific separator.A, B, C, D
@localizer/format-list 1.1.3
A :: B :: C :: D
Configurable formatter for lists of items.A :: B :: C :: D
preview
@localizer/format-lookup 1.0.5
Lookup formatter
Configurable formatter based on look-up tables.Lookup formatter
@localizer/format 1.1.3
A, B, C, or D
Formats lists by joining elements with "or".A, B, C, or D
@localizer/format 1.1.3
[object Object]
Formats values using string coercion.[object Object]
experimental
@localizer/translate 1.2.1
Translation map
Formatter for complex values containing translations.Translation map