Skip to content
On this page

wm-kit / Exports / priceSubtract

Function: priceSubtract

priceSubtract(...args): number

数字类型相减

Parameters

NameTypeDescription
...argsTParams[]add(args1,args2,args3,.....) args代表是剩余参数 argsX:number|string 第一个参数代表被减数 其他参数代表减数

Returns

number

返回number类型的相减值

示例:

ts
import { priceSubtract } from 'wm-kit'
// 错误用法
123.45 - 0.1 // => 123.35000000000001
// 正确用法
priceSubtract(123.45, 0.1) // => 123.35

Author

曹海

Defined in

src/modules/price/index.ts:62

Released under the MIT License.