decimal
The decimal package allows you to deal with decimal numbers without losing precision.
3.2.6
736K downloads/mo
#422 most downloaded on pub.dev
a14n/dart-decimal
What this package is like to depend on
Last release 26 days ago
28 Jul 2026
Release timing varies
gaps range from 2 weeks to 13 months
Most releases are documented
notes for 35 of 43 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
44 releases · first in 2013
2 releases in the last 12 months
see the full history below
Release timeline
44 releases · Jan 2013 to Jul 2026Releases
latest 44-
3.2.628 Jul 2026 -
3.2.517 Jul 2026 -
3.2.422 Jun 2025Release notes
Open source →- Fix issue with scale of zero causing problem in addition/substraction with zero.
-
3.2.319 Jun 2025Release notes
Open source →- Fix bad scale value by parsing
0.0(see Issue with Decimal.tryParse return value formatting)
- Fix bad scale value by parsing
-
3.2.215 Jun 2025Release notes
Open source →- loosen
intlto>=0.19.0 <0.21.0to address Intl version within flutter_localizations makes version 3.2.1 of decimal impossible to use on Flutter v3.29.3 - Bump
lintsto 5.0.0 - Make
Decimal.zero,Decimal.one, andDecimal.tenfinal
- loosen
-
3.2.120 Jan 2025 -
3.2.019 Jan 2025 -
3.1.022 Nov 2024 -
3.0.209 Jun 2024Release notes
Open source →- Fix #107: avoid exception when formatting decimal with
NumberFormat.compact().
- Fix #107: avoid exception when formatting decimal with
-
3.0.104 Jun 2024 -
3.0.002 Jun 2024Release notes
Open source →- Add
DecimalFormatterto deal with intl package. Your can now parse and format decimals. - Add a dependency to intl.
- Add
-
2.3.308 Jul 2023 -
2.3.207 Dec 2022 -
2.3.124 Nov 2022 -
2.3.007 Sep 2022Release notes
Open source →- (Breaking change) Fix
Decimal.powreturn type. This method now returns aRationalbecause3.pow(-1)(similar to1/3) could not be represented as aDecimal. - Allow
Rational.toDecimal()customization via its newtoBigIntparameter.
- (Breaking change) Fix
-
2.2.019 Apr 2022 -
2.1.022 Dec 2021Release notes
Open source →- Fix toStringAsExponential returns INFINITY by implementing
toStringAsExponentialwithout relying on double implementation. - Fix issue to have
zero.precision == 1.
- Fix toStringAsExponential returns INFINITY by implementing
-
2.0.120 Dec 2021 -
2.0.029 Nov 2021Release notes
Open source →The goal of this version is to have sharper types on the API and to avoid having [Decimal] objects that are not decimal numbers (
1/3for instance).It introduces several breaking changes.
~/now returns aBigInt. If you need aDecimalyou can convert theBigInttoDecimalwithbigint.toDecimal().- Removal of
isNaNgetter. It was always returningfalse. - Removal of
isInfinitegetter. It was always returningfalse. - Removal of
isNegativegetter. You can replace it withdecimal < Decimal.zero. inverse,/now return aRational. If you need aDecimalyou can convert theRationaltoDecimalwithrational.toDecimal(scaleOnInfinitePrecision: xxx). If you need to make several computations where inverses or divisions are involved you should make thoses operations onRationaltype to avoid loosing precision and at the end convert the result back toDecimalif you want to display the result in a decimal form.
Other changes:
round(),floor(),ceil(),truncate()now accept an optionalscaleto indicate at which digit the operation should be done.- Add
shiftto move the decimal point. - Add extension method
hasFinitePrecisiononRationalto know if a decimal form of the rational is possible without loosing precision. - Add extension method
toDecimal()onRational. - Add extension method
toDecimal()onint. - Add extension method
toDecimal()onBigInt.
-
1.5.017 Nov 2021Release notes
Open source →- Support json serialization as String with
Decimal.fromJson/Decimal.toJson.
- Support json serialization as String with
-
1.4.016 Nov 2021 -
1.3.021 Jul 2021 -
1.2.031 May 2021 -
1.1.029 Apr 2021 -
1.0.025 Feb 2021 -
1.0.0+129 Mar 2021 -
1.0.0-nullsafety27 Nov 2020 pre-release -
0.3.503 Sep 2019 -
0.3.429 Jul 2019 -
0.3.316 Jan 2019 -
0.3.224 Jul 2018 -
0.3.110 Jul 2018 -
0.3.010 Jul 2018 -
0.2.015 Apr 2018 -
0.1.416 Jun 2017 -
0.1.329 Oct 2014Release notes
Open source →- add
Decimal.signum - add
Decimal.hasFinitePrecision - add
Decimal.precision - add
Decimal.scale
- add
-
0.1.225 Jul 2014Nothing published for this version
-
0.1.128 Nov 2013Nothing published for this version
-
0.1.020 Nov 2013Nothing published for this version
-
0.0.509 Nov 2013Nothing published for this version
-
0.0.417 Apr 2013Nothing published for this version
-
0.0.323 Jan 2013Nothing published for this version
-
0.0.222 Jan 2013Nothing published for this version
-
0.0.120 Jan 2013Nothing published for this version