Skip to content

Home > @esengine/ecs-framework-monorepo > MathUtils > toPrecision

MathUtils.toPrecision() method

将数值转换为指定精度

Signature:

typescript
static toPrecision(value: number, precision: number): number;

Parameters

Parameter

Type

Description

value

number

数值

precision

number

精度(小数位数)

Returns:

number

转换后的数值

基于 MIT 许可证发布