Skip to content

@ryanuo/utils / finance / roundTo

Function: roundTo() ​

ts
function roundTo(num, decimalPlaces?): Decimal;

四舍五入(银行家舍入法)

Parameters ​

num ​

string | number | Decimal

数字或Decimal实例

decimalPlaces? ​

number = 2

保留小数位数

Returns ​

Decimal