765 B
765 B
Amount
The amount formatter returns a number based on the locale by using Intl NumberFormat specification.
Features
- formatAmountHtml: returns a formatted amount based on locale to be used in lit-html
- formatAmountHtmlString: returns a formatted amount based on locale as a string
How to use
Installation
npm i --save @lion/localize
Example
import { formatAmountHtml } from '@lion/localize';
// inside your webcomponent
render () {
return html`
The current cart values is ${formatAmountHtml(1999.9)}.
`;
}
// output (depending on locale)
// The current cart values is EUR 1.999,<span style="">90</span>.