MCPcopy Create free account
hub / github.com/Barrior/JParticles / toFixed

Function toFixed

src/utils/str-num.ts:13–15  ·  view source on GitHub ↗
(num: number | string, digits = 0)

Source from the content-addressed store, hash-verified

11 * 包装原生 toFixed,确保输出数字而不是字符串
12 */
13export function toFixed(num: number | string, digits = 0): number {
14 return parseFloat(Number(num).toFixed(digits))
15}
16
17/**
18 * 移除字符串内所有空白,包括空格、空行、制表符

Callers 2

str-num.spec.tsFile · 0.90
createLinesMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected