NumUtil class
数字处理工具
Num Util.
Constructors
- NumUtil()
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
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
add(
num a, num b) → double - 加 (精确相加,防止精度丢失). add (without loosing precision).
-
addDec(
num a, num b) → Decimal - 加 (精确相加,防止精度丢失). add (without loosing precision).
-
addDecStr(
String a, String b) → Decimal - 加
-
divide(
num a, num b) → double - 除 (精确相除,防止精度丢失). divide (without loosing precision).
-
divideDec(
num a, num b) → Rational - 除 (精确相除,防止精度丢失). divide (without loosing precision).
-
divideDecStr(
String a, String b) → Rational - 除
-
getDoubleByValueStr(
String valueStr, {double? defValue = 0}) → double? - get double by value str.
-
getIntByValueStr(
String valueStr, {int? defValue = 0}) → int? - get int by value str.
-
getNumByValueDouble(
double? value, int fractionDigits) → num? -
The parameter
fractionDigits
must be an integer satisfying:0 <= fractionDigits <= 20
. -
getNumByValueStr(
String valueStr, {int? fractionDigits}) → num? -
The parameter
fractionDigits
must be an integer satisfying:0 <= fractionDigits <= 20
. -
greaterOrEqual(
num a, num b) → bool - Relational greater than or equal operator.
-
greaterOrEqualDecStr(
String a, String b) → bool - Relational greater than or equal operator.
-
greaterThan(
num a, num b) → bool - Relational greater than operator.
-
greaterThanDecStr(
String a, String b) → bool - Relational greater than operator.
-
isZero(
num? value) → bool - isZero
-
lessThan(
num a, num b) → bool - Relational less than operator.
-
lessThanDecStr(
String a, String b) → bool - Relational less than operator.
-
multiply(
num a, num b) → double - 乘 (精确相乘,防止精度丢失). multiply (without loosing precision).
-
multiplyDec(
num a, num b) → Decimal - 乘 (精确相乘,防止精度丢失). multiply (without loosing precision).
-
multiplyDecStr(
String a, String b) → Decimal - 乘
-
remainder(
num a, num b) → Decimal - 余数
-
remainderDecStr(
String a, String b) → Decimal - 余数
-
subtract(
num a, num b) → double - 减 (精确相减,防止精度丢失). subtract (without loosing precision).
-
subtractDec(
num a, num b) → Decimal - 减 (精确相减,防止精度丢失). subtract (without loosing precision).
-
subtractDecStr(
String a, String b) → Decimal - 减
-
thanOrEqual(
num a, num b) → bool - Relational less than or equal operator.
-
thanOrEqualDecStr(
String a, String b) → bool - Relational less than or equal operator.