eo-formatter-number
<eo-formatter-number>
数字格式化,支持普通数字、货币、百分比、二进制字节等数字的格式化显示。
Examples
Basic
Currency
Percent
Bytes
Fallback
Customizations
Properties
Name | Description | Type | Default | Required |
---|---|---|---|---|
value | number | |||
type | 格式化类型 | NumberType | ||
currency | 货币名 | string | "CNY" | |
unit | string | |||
originalUnit | 原始单位,用于单位转换 | NumberOriginalUnit | ||
decimals | 保留的小数位数 | number | ||
thousandsSeparator | 是否启用千分位分隔符 | boolean | true | |
fallback | 当 value 为空或不是数字时的回退显示内容 | string |
Type references
NumberType
"decimal" | "currency" | "percent" | "unit"
NumberOriginalUnit
"bytes" | "B" | "KB" | "MB" | "GB" | "TB" | "PB" | "bibytes" | "KiB" | "MiB" | "GiB" | "TiB" | "PiB"