EccNumber
EccNumber displays numbers, amounts and percentages in the platform format (German locale). It is a display component.
import { EccNumber } from "@/ecc/components/forms/EccNumber";
The component uses the basic props of all field components - see Component Basics.
Examples
<EccNumber fieldLabel="Quantity" value={12} /> {/* 12 */}
<EccNumber fieldLabel="Unit price" value={1234.5} decimals /> {/* 1.234,50 */}
<EccNumber fieldLabel="Net amount" value="variables.purchase.netTotal" data={process} currency="EUR" /> {/* 1.234,50 € */}
<EccNumber fieldLabel="Share" value={0.755} numberFormat="percent1" /> {/* 75,5 % */}
<EccNumber fieldLabel="Volume" value={1250000} numberFormat="compact" /> {/* 1,3 Mio. */}
<EccNumber fieldLabel="Rate" value={1.08234} numberFormat="decimal4" align="right" />
<EccNumber fieldLabel="Amount" value={99.9} currency="EUR" currencyDisplay="code" /> {/* 99,90 EUR */}
Props
Basic props, plus:
|
| - | number or dot path |
|
| - | object for the path |
|
|
| two decimal places ( |
| preset | - |
|
|
| - |
|
|
|
| how the currency is shown |
|
| - | additional options for special cases |
|
|
| alignment |
Copying (copyable) copies the raw number, not the formatted text.
Related
super component: basic props | |
for numbers that are entered as text |
On this page
- EccNumber