Numeric

Formats numeric values based on language (US only for now).

Default

<e-numeric value="10000000"></e-numeric>
<e-numeric value="10000000"></e-numeric>
JavaScript

Variations

Precision[precision="2"]

<e-numeric value="10000000" precision="2"></e-numeric>
<e-numeric value="10000000" precision="2"></e-numeric>
JavaScript

Percent[type="percent"]

<e-numeric value="0.1" type="percent"></e-numeric>
<e-numeric value="0.1" type="percent"></e-numeric>
JavaScript

Currency[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

Humanize[humanize="k"]

<e-numeric value="25645" humanize="k" precision="1"></e-numeric>
<e-numeric value="25645" humanize="k" precision="1"></e-numeric>
JavaScript

Humanize[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

Trim fraction zeros[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

API Reference

Properties

NameDescriptionTypeRequiredDefault value
valueDefines the value.number
typeDefines type of format."number" | "percent" | "currency"number
precisionDefines the fix precision.number0
trim-fraction-zerosTrim the fraction zeros at the end of the number after applying precision.booleanfalse
currencyDefines the currency if type is currency.stringEUR
humanizeFormats a number to a more human-readable string.['auto'|k'|'m'|'b'|'t']