Home > @dinofe/xt-core > times

# times() function

两浮点数相乘

Signature:

export declare function times(arg1: number | string | TBig, arg2: number | string | TBig): TBig;

# Parameters

Parameter Type Description
arg1 number | string | TBig 数字 1
arg2 number | string | TBig 数字 2

Returns:

TBig

Big

# Remarks

修复了 js 乘法精度丢失问题,基于 big.js (opens new window) 实现

# Example

import { times } from '@dinofe/xt-core/common'
times(1.33, 2).toNumber() // 2.66