modern-now

Back

Numbers

Inspired by shoelace but usable on regular span elements with a data-number attribute, which stores the values

You can use data-number-config with a simple config or you can pass any parameter of Intl.NumberFormat as data attributes if you prefer.

data-number is an observed attribute and changing its value will render the tag again.

Demos

data-number is converted, and localized when using lang attribute.

Number :
Number in german :

data-currency allows setting a specific currency. Set lang, name or fraction.

Currency :
Currency name :
Currency in german :
Currency in german eur :
Currency in german :

Display decimal percents to full values.

Percent :