Liking cljdoc? Tell your friends :D

ty.i18n.number

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.
raw docstring

format-compactcljs

(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)
sourceraw docstring

format-currencycljs

(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'
sourceraw docstring

format-numbercljs

(format-number number)
(format-number number locale)
(format-number number locale options)

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 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
sourceraw docstring

format-percentcljs

(format-percent number)
(format-percent number locale)

Format a number as percentage

Format a number as percentage
sourceraw docstring

locale->stringcljs

(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'
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close