Numeric
Formats numeric values based on language (US only for now).
Default
Copy Pug Copy HTML Open in playground Show code Hide code
<e-numeric value="10000000"></e-numeric><e-numeric value="10000000"></e-numeric>JavaScript Copy JavaScript
Variations
Precision Copy Pug Copy HTML Open in playground Show code Hide code[precision="2"]
<e-numeric value="10000000" precision="2"></e-numeric><e-numeric value="10000000" precision="2"></e-numeric>JavaScript Copy JavaScript
Percent Copy Pug Copy HTML Open in playground Show code Hide code[type="percent"]
<e-numeric value="0.1" type="percent"></e-numeric><e-numeric value="0.1" type="percent"></e-numeric>JavaScript Copy JavaScript
Currency Copy Pug Copy HTML Open in playground Show code Hide code[type="currency", currency="USD"]
<e-numeric value="256" type="currency" currency="USD"></e-numeric><e-numeric value="256" type="currency" currency="USD"></e-numeric>JavaScript Copy JavaScript
Humanize Copy Pug Copy HTML Open in playground Show code Hide code[humanize="k"]
<e-numeric value="25645" humanize="k" precision="1"></e-numeric><e-numeric value="25645" humanize="k" precision="1"></e-numeric>JavaScript Copy JavaScript
Humanize Copy Pug Copy HTML Open in playground Show code Hide code[humanize="auto"]
<e-numeric value="25645000" humanize="auto" precision="2" type="currency" currency="USD"></e-numeric><e-numeric value="25645000" humanize="auto" precision="2" type="currency" currency="USD"></e-numeric>JavaScript Copy JavaScript
Trim fraction zeros Copy Pug Copy HTML Open in playground Show code Hide code[precision="2", trim-fraction-zeros="true"]
<e-numeric value="25645.0034" precision="2" trim-fraction-zeros="true"></e-numeric><e-numeric value="25645.0034" precision="2" trim-fraction-zeros="true"></e-numeric>JavaScript Copy JavaScript
API Reference
Properties
| Name | Description | Type | Required | Default value |
|---|---|---|---|---|
| value | Defines the value. | number | ||
| type | Defines type of format. | "number" | "percent" | "currency" | number | |
| precision | Defines the fix precision. | number | 0 | |
| trim-fraction-zeros | Trim the fraction zeros at the end of the number after applying precision. | boolean | false | |
| currency | Defines the currency if type is currency. | string | EUR | |
| humanize | Formats a number to a more human-readable string. | ['auto'|k'|'m'|'b'|'t'] |