Skip to content

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:

NameTypeDescription
valuenumberThe value to be displayed in the currency format.
locale
(optional)
stringThe locale to be used. If not set, the default locale of the browser will be used.
currency
(optional)
stringThe currency to be used for formatting the value.
decimals
(optional)
numberThe 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>