NumberTrait
trait NumberTrait
Numbers Helpers
Methods
string
numberAdd(mixed $a, mixed $b, int $scale = 2)
数值相加
string
numberSubtract(mixed $a, mixed $b, int $scale = 2)
减法
string
numberMultiply(mixed $a, mixed $b, int $scale = 2)
乘法计算
string
numberDivide(mixed $a, mixed $b, int $scale = 2)
除法
string
numberFee(mixed $amount, mixed $fee_rate = 0.0, int $scale = 2)
计算费率
int
numberCompare(mixed $a, mixed $b, int $scale = 2)
数值比较
string
numberRound(mixed $a, int $precision = 0, int $scale = 2)
获取字四舍五入串值 Returns the current raw value of this BigNumber
Details
at line 23
string
numberAdd(mixed $a, mixed $b, int $scale = 2)
数值相加
at line 35
string
numberSubtract(mixed $a, mixed $b, int $scale = 2)
减法
at line 47
string
numberMultiply(mixed $a, mixed $b, int $scale = 2)
乘法计算
at line 59
string
numberDivide(mixed $a, mixed $b, int $scale = 2)
除法
at line 75
string
numberFee(mixed $amount, mixed $fee_rate = 0.0, int $scale = 2)
计算费率
at line 94
int
numberCompare(mixed $a, mixed $b, int $scale = 2)
数值比较
返回值 0: 相等 , 1: a大于b; -1: a小于b
at line 108
string
numberRound(mixed $a, int $precision = 0, int $scale = 2)
获取字四舍五入串值 Returns the current raw value of this BigNumber