NP class
Properties
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
toString()
→ String
-
A string representation of this object.
inherited
Static Methods
-
checkBoundary(dynamic number)
→ void
-
检测数字是否越界,如果越界给出提示
number
数据
-
digitLength(dynamic number)
→ num
-
返回小数的位数
number
数据
-
divide(dynamic num1, dynamic num2, [List? others])
→ num
-
精确除法
-
enableBoundaryChecking([dynamic flag = true])
→ void
-
是否进行边界检查,默认开启
flag
标记开关,true 为开启,false 为关闭,默认为 true
-
float2Fixed(dynamic number)
→ num
-
把小数转成整数,支持科学计数法。如果是小数则放大成整数
number
数据
-
minus(dynamic num1, dynamic num2, [List? others])
→ num
-
精确减法
-
parseNum(dynamic number)
→ num
-
字符串转为num类型
number
数据
-
plus(dynamic num1, dynamic num2, [List? others])
→ num
-
精确加法
-
round(dynamic number, int ratio)
→ num
-
四舍五入
-
strip(dynamic number, {int precision = 14})
→ num
-
把错误的数据转正
strip(0.09999999999999998)=0.1
number
数据 precision
截取小数位
-
times(dynamic num1, dynamic num2, [List? others])
→ num
-
精确乘法
num1
左操作数 num2
右操作数
others
更多操作数使用数组传递