From b1c1100563dc3d98e6516b00fa08dc4119c247ff Mon Sep 17 00:00:00 2001 From: ciripel <37701673+ciripel@users.noreply.github.com> Date: Thu, 30 Mar 2023 09:58:12 +0300 Subject: [PATCH] bug/fix-clear (#6) --- CHANGELOG.md | 2 ++ lib/src/sio_big_decimal_base.dart | 4 ++-- pubspec.yaml | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1cc117..b2e35be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## 0.2.2 +- Fix `clear()`. ## 0.2.1 - Revert `zero()` cause `const` is very valuable. ## 0.2.0 diff --git a/lib/src/sio_big_decimal_base.dart b/lib/src/sio_big_decimal_base.dart index 1469236..8e142c7 100644 --- a/lib/src/sio_big_decimal_base.dart +++ b/lib/src/sio_big_decimal_base.dart @@ -405,7 +405,7 @@ class BigDecimal extends Equatable implements Comparable { ? _copyWith(sign: '') : _copyWith(sign: '-'); - BigDecimal clear() => _copyWith(abs: [0], dec: [], sign: ''); + BigDecimal clear() => BigDecimal.zero(precision: precision); BigDecimal removeValue() { if (_abs.isEmpty) return _copyWith(); @@ -496,5 +496,5 @@ class BigDecimal extends Equatable implements Comparable { } @override - List get props => [_sign, _abs, _dec]; + List get props => [_sign, _abs, _dec, precision]; } diff --git a/pubspec.yaml b/pubspec.yaml index 61deb3f..66e7d9a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: sio_big_decimal description: Numeric library to manipulate very big numbers keeping very high precision. -version: 0.2.1 +version: 0.2.2 repository: https://github.com/SimplioOfficial/sio_big_decimal environment: