跳到主要内容

eo-formatter-number

<eo-formatter-number>

数字格式化,支持普通数字、货币、百分比、二进制字节等数字的格式化显示。

Examples

Basic

Playground

Currency

Playground

Percent

Playground

Bytes

Playground

Fallback

Playground

Customizations

Playground

Properties

NameDescriptionTypeDefaultRequired
valuenumber
type

格式化类型

NumberType
currency

货币名

string "CNY"
unitstring
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"