Number and currency formatting using native Intl.NumberFormat. Extends the Translator protocol for numbers.
Number and currency formatting using native Intl.NumberFormat. Extends the Translator protocol for numbers.
(format-compact number)(format-compact number locale)Format a number in compact notation (1.2K, 3.4M, etc)
Format a number in compact notation (1.2K, 3.4M, etc)
(format-currency number currency)(format-currency number currency locale)Format a number as currency. Currency should be a 3-letter ISO code like 'USD', 'EUR', 'HRK'
Format a number as currency. Currency should be a 3-letter ISO code like 'USD', 'EUR', 'HRK'
(format-number number)(format-number number locale)(format-number number locale options)Format a number using Intl.NumberFormat. Options can include:
Format a number using Intl.NumberFormat. Options can include: - :style - 'decimal' (default), 'currency', 'percent', 'unit' - :currency - currency code when style is 'currency' - :minimumFractionDigits - minimum decimal places - :maximumFractionDigits - maximum decimal places - :useGrouping - whether to use grouping separators
(format-percent number)(format-percent number locale)Format a number as percentage
Format a number as percentage
(locale->string locale)Convert locale keyword to string format for Intl API. :en_US -> 'en-US'
Convert locale keyword to string format for Intl API. :en_US -> 'en-US'
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |