diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b11432..fc368fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # CHANGELOG +## 0.4.0 +- Add `zero`, `one` and `two` static values: e.g. `BigDecimal.zero` + ## 0.3.1 - Add missing hashCode implementation ~aka remove feature where all BigDecimals were different~ diff --git a/lib/src/big_decimal.dart b/lib/src/big_decimal.dart index fb89cea..ae43e24 100644 --- a/lib/src/big_decimal.dart +++ b/lib/src/big_decimal.dart @@ -30,6 +30,10 @@ class BigDecimal implements Comparable { ); } + static BigDecimal zero = BigDecimal.fromBigInt(BigInt.zero); + static BigDecimal one = BigDecimal.fromBigInt(BigInt.one); + static BigDecimal two = BigDecimal.fromBigInt(BigInt.two); + static int nextNonDigit(String value, [int start = 0]) { var index = start; for (; index < value.length; index++) { diff --git a/pubspec.yaml b/pubspec.yaml index 79041c1..68e9ca0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: big_decimal -version: 0.3.1 +version: 0.4.0 description: > A bugless implementation of BigDecimal in Dart based on Java's BigDecimal