EN: Floating point number to percentage 0.2 => 20%
ZH: 浮点数转为百分比 0.2 => 20%。
Usage:
const ret1 = floatToPercent(0.2);const ret2 = floatToPercent(0.2, 2);console.log(ret1);console.log(ret2); Copy
const ret1 = floatToPercent(0.2);const ret2 = floatToPercent(0.2, 2);console.log(ret1);console.log(ret2);
Output:
20% 20.00% Copy
20% 20.00%
浮点数
保留几位浮点数
EN: Floating point number to percentage 0.2 => 20%
ZH: 浮点数转为百分比 0.2 => 20%。
Usage:
Output: