PackageTrack
Sign in Get early access

fixed

Fixed scale decimal numbers with mathematical operations, formatting and parsing.

6.2.0 143K downloads/mo #978 most downloaded on pub.dev onepub-dev/fixed

What this package is like to depend on

Last release 8 days ago

16 Aug 2026

Ships unpredictably

gaps range from 8 days to 10 months

Nearly every release is documented

notes for 33 of 35 stable releases

Nothing withdrawn

no release was ever pulled

5 years old

40 releases · first in 2021

3 releases in the last 12 months

see the full history below

Release timeline

40 releases · Nov 2021 to Aug 2026
2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 40
  1. 6.2.0 16 Aug 2026
    Release notes
    • upgraded to intl ^0.20.3
    Open source →
  2. 6.1.1 15 Oct 2025
    Release notes
    • reduced the sizes of the onepub logo.
    Open source →
  3. 6.1.0 03 Oct 2025
    Release notes
    • Fix for https://github.com/onepub-dev/fixed/issues/24 pow returns incorrect results. thanks to @zamahaka for raising hte issue.
    • Fix fro https://github.com/onepub-dev/fixed/issues/23 Fixed now supports division with numbers of scale > 20. thanks to @zamahaka for raising the issue.
    • applied latest lint hard.
    • fixe for tiny division
    Open source →
  4. 6.0.0 26 Apr 2025
    Release notes

    BREAKING: all references to 'scale' (mainly method parameters) have been changed to 'decimalDigits'. This is to bring the package in line with the Money2 package which Fixed was built to support.

    Added: 'decimalDigits' to the multiply method so you can now directly control the scale of the passed multiplier.

    Open source →
  5. 5.3.4 18 Apr 2025
    Release notes
    • added an optional [scale] to the [multiply] method.
    Open source →
  6. 5.3.3 16 Mar 2025
    Release notes
    • Added method decimalPartAsString which returns the decimal component with leading zeros if required.
    Open source →
  7. 5.3.2 29 Jan 2025
    Release notes
    • removed max_scale as I don't think it is actually necessary and it was causing rounding errors when doing large multiplications. The only place a limit seems to be required is in fromNum. Fixed #21
    • upgraded intl to latest version.
    Open source →
  8. 5.3.1 24 Jan 2025
    Release notes
    • Corrected a mistake in the doco for Fixed.parse. It doesn't default to 2 but the rather the number of decimals present in the passed in string.
    Open source →
  9. 5.3.0 19 Jan 2025
    Release notes
    • change the Fixed operator == method to be conformant with the dart standard to not throw regardless of the left hand side. Thanks to @yehorh for reporting the issue.
    Open source →
  10. 5.2.1 19 Jan 2025
    Release notes
    • Fixed issue: #19 which cased by a rounding issue in the rescale logic. Thanks to @vi-k for reporting the issue.
    • re-orged the unit tests into smaller files.
    Open source →
  11. 5.2.0 29 Nov 2024
    Release notes
    • changed copyWith from a static to a member method in keeping with dart conventions. deprecated the old static method. Will be removed in 6.0
    Open source →
  12. 5.1.0 24 Sep 2024
    Release notes
    • upgraded to decimal 3.x
    Open source →
  13. 5.0.1 24 Aug 2024
    Release notes
    • Fixed a bug where we didn't allow a decimal number to start with dot - e.g. 0.1 == .1
    • added unit tests for constant values.
    Open source →
  14. 5.0.0 01 Jul 2024
    Release notes
    • BREAKING: Changed Fixed.one, Fixed.zero, Fixed.two and Fixed.ten to be 'decimalDigits:0' when previously there were scale 16. This means the display as an integer value (more in line with what is expected) and when combined with other values that have a larger scale then the other value will dictate the scale rather then forcing scale 16 on the results.

    • Fixed a bug in tryParse where it would throw rather than returning null on some input (such as an empty string).

    Open source →
  15. 4.3.0 19 Mar 2024
    Release notes
    • renamed IllegalPatternException to IllegalFitxedPatternException as the original name was colliding with an exception on Money2 with the same name. Used a minor version so that users would automatically get this fix. 4.2 probably should have been a major version no.
    Open source →
  16. 4.2.0 16 Mar 2024
    Release notes
    • moved all exceptions into exceptions.dart. Exported exceptions.dart so users can explicitly catch each of these exceptions. Change the exception hierarcy so all exceptions derive from FixedException which was the documented and inteneded heirarchy.
    Open source →
  17. 4.1.1 18 Feb 2024
    Release notes
    • updated the doco for fixed constancts (one, zero, two, ten) to reflect that they actually have a scale of 16 not 2.
    Open source →
  18. 4.1.0 17 Feb 2024
    Release notes
    • upgraded to intl 0.19
    Open source →
  19. 4.0.1 01 Aug 2023
    Release notes
    • fixed link to onepub image.
    Open source →
  20. 4.0.0 01 Aug 2023
    Release notes
    • moved the min sdk version to dart 3.x
    Open source →
  21. 3.0.1 05 Jun 2023
    Release notes
    • fixes #13 toInt was not returning the expected value.
    • thanks to flodiebold for raising the issue and providing the solution.
    Open source →
  22. 3.0.0 15 May 2023
    Release notes
    • updated to dart 3.x
    Open source →
  23. 2.4.0 13 Mar 2023
    Release notes
    • Updated version of intl and meta to latest.
    Open source →
  24. 2.3.3 27 Dec 2022
    Release notes
    • Fixed: #11 - zero divide when calling Fixed.toInt when Fixed is zero. Thanks to dmitry-kotorov for reporting this bug. Z
    • Removed the 'Unauthorized copying of this file' notice that had incorrectly been applied to some files. The code is fully MIT.
    Open source →
  25. 2.3.2 20 Nov 2022
    Release notes
    • Fixed for #10 as reported b7 @oakstair. Trunction of decimals rather than the required rounding when the calling tryParse with a string with scale larger than the passed scale.
    Open source →
  26. 2.3.0 10 Sep 2022
    Release notes
    • updated min sdk to 2.14 as latest version of decimal requires 2.14.
    • Applied lint_hard rules.
    • upgrade to decimal-2.3.0 to resolve breaking change between decimal 2.2 and 2.3 Thanks to Alexandre Ardhuin @a14n for the patch.
    Open source →
  27. 2.2.1 31 Aug 2022
    Release notes
    • Fixed rouding problem when multiplying -ve numbers.
    Open source →
  28. 2.2.0 31 Aug 2022
    Release notes
    • BREAKING: change the default toString format to include a leading zero for numbers less than 1. This is inline with user expectations but a change for the prior releases.
    Open source →
  29. 2.1.0 31 Aug 2022
    Release notes
    • upgraded to decimal 2.2.
    • made takeMinorDigits private as its not part of the public api.
    Open source →
  30. 2.0.0 05 Jun 2022

    Nothing published for this version

  31. 2.0.0-beta.1 04 Jun 2022 pre-release
    Release notes
    • updated the home/repository links to onepub-dev.
    • Breaking: Change the default scale when creating a Fixed from a 'num' from 2 to 16. This is an attempt to make Fixed values built from a num work as the user expects it to.
    • Rewrote the formatter to remove its reliance on NumberFormat as it can't handle large BigInts.
    • Internal storage has moved from Decimal to BigInt to make support easier. Possible performance gain as well.
    Open source →
  32. 1.1.0 20 Dec 2021
    Release notes
    • Fixed #7 We now include platform specific defs of max and min ints as the web version of dart ints are only 53 bits.
    Open source →
  33. 1.0.3 27 Nov 2021
    Release notes
    • reduce the dart minimum version from 2.14 to 2.12
    • formatting
    Open source →
  34. 1.0.2 26 Nov 2021
    Release notes
    • Fixed a bug in Fixed.copyWith where if the scale wasn't passed the existing scale wasn't retained.
    Open source →
  35. 1.0.1 26 Nov 2021
    Release notes
    • spelling grammar and formatting.
    Open source →
  36. 1.0.0 26 Nov 2021

    Nothing published for this version

  37. 1.0.0-beta4 22 Nov 2021 pre-release
    Release notes
    • Renamed Fixed.from to Fixed.fromNum for consistency with other ctor names.
    • Fixed.fromNum now throws an AmountTooLargeException.
    • Fixed.fromMinorUnits has been renamed Fixed.fromInt
    • Added tests for rescaling and rounding when rescaling.
    • change rescale to round rather than truncate as the truncation was causing unexpected results (e.g. rounding errors).
    • fix issue with decimal without precision
    Open source →
  38. 1.0.0-beta3 21 Nov 2021 pre-release
    Release notes
    • changes the underlying implementation to use the decimal package Thanks to Alexandre Ardhuin for the significant contribution that made this possible :)
    • Created statics for one, two and zero. Created consts for maxInt and minInt. Added ~/, %, remainder, abs, sign, pow, toInt
    • change thousandSeparator to groupSeparator as this is the more generally used term
    • Changed Fixed.fromBigInt to take minor units rather than major units as I found I was constantly misusing it. I think actually makes more sense you can always BigInt.toInt and Fixed.from to create a fixed from a BigInt.
    • Fixed the formatter for small -ve numbers. Added a 'decimalPart' method to return just the decimal component of the fixed no. Renamed majorUnits to 'integerPart'
    Open source →
  39. 1.0.0-beta2 14 Nov 2021 pre-release
    Release notes

    Improved the documentation.

    Open source →
  40. 1.0.0-beta1 14 Nov 2021 pre-release
    Release notes

    First release of Fixed.

    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive