Skip to content

Function: formatPercentValue() ​

ts
function formatPercentValue(value, options?): string;

Formats a percent value that is already on the 0-100 scale. 格式化已经乘以 100 的百分数值。

Parameters ​

ParameterType
valuenumber
optionsFormatPercentValueOptions

Returns ​

string

Example ​

ts
formatPercentValue(50.5) // => '51%'
formatPercentValue(50.5, { digits: 1 }) // => '50.5%'

Since ​

1.3.0

Released under the MIT License.