Currency - Web Component
...
Browser support
Parameters
The Web component uses a <z-currency>
tag.
The parametrization of the component can be done with the following custom HTML params:
Name | Type | Description |
---|---|---|
value | number | The value to be displayed in the currency format. |
locale (optional) | string | The locale to be used. If not set, the default locale of the browser will be used. |
currency (optional) | string | The currency to be used for formatting the value. |
decimals (optional) | number | The number of decimals to be displayed. |
Playground
Customization
HTML Examples
Imports
html
<link rel="stylesheet" href="/0.3.7/@zurich/web-components/styles.css" />
<script type="module" src="/0.3.7/@zurich/web-components/currency.js"></script>
Code
html
<z-currency value="1.23"></z-currency>
<z-currency value="1.23" decimals="0"></z-currency>
<z-currency value="1.23" currency="USD"></z-currency>
<z-currency value="1.23" currency="MXN" locale="es"></z-currency>
<z-currency value="1005" currency="JPY" locale="jp"></z-currency>