Home > @dinofe/xt-core > minus

# minus() function

两数相减

Signature:

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

# Parameters

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

Returns:

TBig

Big

# Remarks

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

# Example

import { minus } from '@dinofe/xt-core/common'
minus(0.3, 0.2) // 0.1