Skip to content

Home > sculp-js > numberAbbr

numberAbbr() function

将数字转换为携带单位的字符串

Signature:

typescript
numberAbbr: (num: number | string, units: Array<string>, options?: INumberAbbr) => string

Parameters

Parameter

Type

Description

num

number | string

units

Array<string>

options

INumberAbbr

(Optional) default: { ratio: 1000, decimals: 0, separator: ' ' }

Returns:

string

{string}

Released under the MIT License.