PackageTrack
Sign in Get early access

money2

Money2 is a high-precision library for storing, parsing, formatting, and performing arithmetic on monetary values and currencies. Fixed-decimal math, multi-currency support and conversions, parsing and formatting. (Money.parse('$2010.00') * 10).format('SCC#,##0') -> $US20,100

6.3.0 135K downloads/mo #1003 most downloaded on pub.dev onepub-dev/money.dart

What this package is like to depend on

Last release 6 months ago

27 Jan 2026

Release timing varies

gaps range from 8 days to 4 months

Most releases are documented

notes for 45 of 66 stable releases

2 versions withdrawn

withdrawn after publishing

7 years old

100 releases · first in 2019

7 releases in the last 12 months

see the full history below

Release timeline

100 releases · Sep 2019 to Jan 2026
2020 2021 2022 2023 2024 2025 2026
Release Pre-release Withdrawn

Releases

latest 60 of 100
  1. 6.3.0 27 Jan 2026

    Nothing published for this version

  2. 6.2.0 26 Jan 2026
    Release notes
    • BREAKING -the currency json format has three new fields, isIso, isDepreated, replacedBy; The fromJson method will set isIso to true, isDrerecated to false and replacedBy to null if they are not present.

    • FIX the Chilean Peso group and decimal separators where reversed, now corrected.

    • FIX spelling of the name of some currencies in line with theiso standards. Djibouti Franc -> Djiboutian Franc CFA Franc BEAC -> Central African CFA Franc

    • FIX some currency use a non-breaking space as per the ISO standard, for the group separator, these have been changed from a normal space for: GNF, XPF

    • FIX the number of decimal palces for the TWD has changed from 2 to 0.

    • Change the source of currencies to 'https://www.six-group.com/dam/download/financial-information/data-center/' 'iso-currrency/lists/list-one.xml'; 'https://raw.githubusercontent.com/unicode-org/cldr-json/48.0.0/cldr-json';

    • add some 30 missing currencies.

    • added some 12 digital currencies.

    • FIXED #99.

    Open source →
  3. 6.1.0 30 Dec 2025
    Release notes
    • There is a merge (of most) of #97 submitted by @fabiocarneiro - thanks to fabio for his excellent work.
    • Robust Decimal/Group Separator Heuristic: A new heuristic dynamically detects decimalSeparator and groupSeparator by analyzing the input string's structure (presence and position of . and ,). This allows Money.parse to correctly interpret formats like 1,246.98 (treating . as decimal) even for EUR, which defaults to ,.
    • The heuristic is only applied if both separators are present in the input to prevent input such as 9,00 being mis-interpreted as 900 rather than 9.
    • Accurate Major/Minor Unit Extraction: The ValueQueue._takeDigits method was refined to strictly differentiate between digits, group separators, and the detected decimal separator. This ensures major units stop precisely at the decimal point.
    • Correct Truncation/Scaling Flow: PatternDecoder now extracts the full precision of minor units from the input string. The Fixed amount is then constructed with this full parsed precision. The final truncation or scaling to currency.decimalDigits (as per the "excess digits will be ignored" rule) is handled correctly by Fixed.copyWith during the Money object creation.
    • Precise Negative Number Handling: The calculation of the final value now combines the absolute major and minor units first, and then applies the negative sign (if isNegative is true) to this combined absolute value, preventing off-by-one errors for negative inputs.
    • Improved _isDigit: The _isDigit method was corrected to strictly identify only 0-9 characters as digits, preventing separators from being misinterpreted as numerical values.
    Open source →
  4. 6.0.9 15 Oct 2025
    Release notes
    • added onepubl logo.
    Open source →
  5. 6.0.8 15 Oct 2025
    Release notes
    • updated link to common currencies so it works from pub.dev
    Open source →
  6. 6.0.7 15 Oct 2025
    Release notes
    • updated the readme with more detail and improved the pubspec description.
    • We now generate an md file with the full list of currency codes and their settings.
    • Fixed a spelling mistake in the currencies.yaml file.
    Open source →
  7. 6.0.6 13 Oct 2025
    Release notes
    • now allows a -ve sign before the currency symbol. Fixed a bug in the pattern which included = rather than -.
    Open source →
  8. 6.0.5 13 Aug 2025
    Release notes
    • reverted to character 1.4.0 to support flutter_test.
    Open source →
  9. 6.0.4 13 Aug 2025
    Release notes
    • removed the dependency on strings package by copying a the two functions we used into money2.
    Open source →
  10. 6.0.3 25 Jun 2025
    Release notes
    • Fixeds #96. Change the generator so if the symbol contains a $ we prefix the string with 'r'.
    • spelling.
    Open source →
  11. 6.0.2 24 May 2025

    Nothing published for this version

  12. 6.0.2-beta.2 24 May 2025 pre-release
    Release notes
    • Fixes issue with trailing Currency isoCodes throwing a range exception as reported in #95.
    Open source →
  13. 6.0.2-beta.1 24 May 2025 pre-release
    Release notes
    • BREAKING: Fixes #95. This problem was a regression caused as part of the 6.x release. The issue was that group separators after the first (right most) group where being treated incorrectly.
      We now treat #,### == ###,### and ##,### == ##,###

    We also fixed a long standing issue with common currences. All CommonCurrencies has been defined without group separators. This has now been changed so that all common currencies are defined with the appropriate group separators.

    This means that the pattern for USD (and most other currencies) changes from S0.00 to S#,##0.00. All common currencies are now defined with group separators as appropriate for that currency.

    The implication is that formatting with the old behavour would give $9000 whilst the new behavour would give $9,000. If you want to mimic the old behaviour you can simply set the pattern to the original 'S0.00'.

    We have also changed how we are maintaing common currencies. We are are now generating common currencies from a yaml file. To regenerate common currences run: dart tool/generate_common_currencies.dart

    Open source →
  14. 6.0.1 10 May 2025
    Release notes
    • Added method isNonZero as a convenience.
    Open source →
  15. 6.0.0 26 Apr 2025
    Release notes
    • Breaking All occurances of the Precentage named arg 'scale' have been changed to decimalDigits.
    • change all occurance of scale to decimalDigits. Upgraded to Fixed 6.0
    Open source →
  16. 6.0.0-beta.4 18 Apr 2025 pre-release
    Release notes
    • Breaking: Money operator * now returns the same decimalDigits as the original Money instance. Previously we use the Currencies decimal Digits.
    • upgraded to fixed 5.3.4
    • Fixed broken examples in the readme and the main doco site.
    • Fixed a bug in operator * which truncated the scale of doubles. We now default to 16 digits.
    • Added a new method multiplyByNum to allow the user to expliclity control the scale.
    • created tests for all examples.
    • Added missing hkd from list of common currencies. Thanks to @hwh97 for raising the issue.
    Open source →
  17. 6.0.0-beta.3 23 Mar 2025 pre-release
    Release notes

    BREAKING: change fromCode and toCode to fromIsoCode and toIsoCode in the ExchangeRate.fromMinorUnits and ExchangeRate.fromNum methods to bring it in line with other methods. Change how ExchangeRates are stored to json to bring it in line with how we store money as json.

    /// old format
     Map<String, dynamic> toJson() => {
            'integerPart': 0,
            'decimalPart': 68
            'decimals': 2,
            'fromIsoCode': 'AUD'
            'toIsoCode': 'USD'
            'toDecimalDigits': 3,
          };
    
    /// new format
            'minorUnits': '75312',
            'decimals': 5,
            'fromIsoCode': 'AUD',
            'toIsoCode': 'USD',
            'toDecimals': 3,
    

    Note that 'minorUnits' is a string to avoid overflow issues when javascript parses the json and the integer is larger than a javascript num.

    Open source →
  18. 6.0.0-beta.2 23 Mar 2025 pre-release
    Release notes

    BREAKING: the 'precision' argument to Currencies.copyWith has been renamed from precision to decimalDigits

    Open source →
  19. 6.0.0-beta.1 16 Mar 2025 pre-release
    Release notes
    • Add: support for large numbers. Thanks to @nesquikm's significant contribution we now support numbers upto 100 digits (in both the integer and decimal components) and the library probably works for larger numbers as well - we use BigInt under the hood which is only limited by memory.

    • New formatting engine. We have done a complete rewrite of the engine that formats money amounts which has alowed us to fix a number of long time outstanding issue. In particular we now support the india clustering of thousands '##,###.##' and in general the engine should prove to be much more flexible.

    • Add: we now support the '+' character in a pattern. When present we will either print '+' or '-' based on the sign of the number. This compares with the '-' pattern which will print a '-' (if the amount is -ve) but never a '+' character.

    • Breaking: a pattern for the integer component like '0#' is now illegal and will throw. If used the '0' character can only come after any '#' character e.g. '#0' is allowed.

    • Breaking: a pattern for the decimal component like 'xxxx.#0' is now illegal and will throw. If used the '0' character must come before any '#' character e.g. 'xxx.0#' is allowed.

    • Breaking: change the json format as the current format was likely to break any javascript code that tried to parse it when it contained a large number. Given the breaking change we also took the opportunity to improve the format. We now have 'minorUnits', 'decimals' and 'isoCode' as the three fields.

      For example to store the value USD $10.25

      The old format contained four fields:

            'integerPart': 10
            'decimalPart': 25
            'decimals': 2
            'isoCode': 'USD"
    

    The new format only has 3 fields and the minor units are a string to avoid javascript consumers throwing on big values:

         final expectedJson = <String, dynamic>{
        'minorUnits': '1025',
        'decimals': 2,
        'isoCode': 'USD',
        };
    
    • Additional IllegalPatternException are now thrown when formatting a number if the pattern is invalid.
    Open source →
  20. 5.4.6 07 Dec 2024
    Release notes
    • modified Percentage.tryParse to return null if the amount can't be parsed. Previoulsy we returned zero which isn't in keeping with the expected signature a tryParse method.
    Open source →
  21. 5.4.5 06 Dec 2024
    Release notes
    • changed percentage.copyWith so it returns a Percentage not a Fixed.
    Open source →
  22. 5.4.4 30 Nov 2024
    Release notes
    • Fixed a bug in the multipledByPercent, it was failing to divide by 100 after we changed the way percentages are represented.
    Open source →
  23. 5.4.3 30 Nov 2024
    Release notes
    • added additional tests.

    • fixed arg names to divide methods.

    • added methods multipliedByPercentage percentageOf

    • added helper class Percentage. as a whole number rather than a decimal e.g. 10% is stored as 10 not 0.1

    Open source →
  24. 5.4.2 30 Nov 2024 withdrawn

    Nothing published for this version

  25. 5.4.1 29 Nov 2024 withdrawn

    Nothing published for this version

  26. 5.4.0 05 Nov 2024
    Release notes
    • added json serialisation to Money, Currency and ExchangeRate A big thanks to https://github.com/marcelomendoncasoares for this excellent contribution.
    Open source →
  27. 5.3.0 24 Sep 2024
    Release notes
    • Merge pull request #88 from bryanoltman/bo/fix-typo
    • fix typo in README.md
    • upgraded to decmial 3.x
    Open source →
  28. 5.2.1 03 Aug 2024
    Release notes
    • added copyWith ctor for money.
    Open source →
  29. 5.2.0 03 Aug 2024
    Release notes
    • added a test to check for inequality when the 'other' type is not a money now that we accept an Object? for other.
    • Merge pull request #86 from karelklic/operator== which now takes an Object? for other so that we work with the likes of the freezed package.
    Open source →
  30. 5.1.0 01 Jul 2024
    Release notes
    • Added additional conversion operations. Upgraded to Fixed 5.0.
    • released 5.0.1
    Open source →
  31. 5.0.1 04 Apr 2024

    Nothing published for this version

  32. 5.0.0 04 Apr 2024
    Release notes

    The driver for this release and the breaking changes comes from: https://github.com/onepub-dev/money.dart/issues/79

    The aim is to allow users to fully customise the group and decimal separators. We have also renamed 'scale' to 'decimalDigits' as this term is likely to be more familiar to users.

    breaking changes

    • The 'invertSeparator' argument to the Currency class has been broken out into two separate arguments 'groupSeparator' and 'decimalSeparator'. If you are using 'invertSeparator: true' then you need to replace this with
      groupSeparator: '.',
      decimalSeparator: ',',
    
    • patterns used for parsing and formatting must always use ',' for group separators and '.' for decimal separators regardless of what has been used for the groupSeparator and decimalSeparator. This allows a single pattern to be used across currencies rather than having to create a unique pattern for each currency when looking to use custom formats.

    This means that if you have been using 'invertSeparator: true' then you will need to modifiy any custom patterns from '#.###,##' to '#,###.##'. Note the change in the separators!

    • For methods that take a 'code' it has been renamed 'isoCode' to make the correct use of the code more apparent.

    • renamed PatterDecoder.isCode to isIsoCode

    • renamed CurrencyCode to CurrencyIsoCode

    • renamed all occurances of 'scale' to 'decimalDigits' as many people are not familiar with the concept of scale.

    • changed toScale on ExchangeRate members to be 'toDecimalDigits'.

    non-breaking changes

    • Fixed doco for Currencies class as it is a singleton and it's needs methods need to be called via Currencies()...

    Full set of currency codes

    Thanks to the work of fueripe-desu we now have a full set of currency codes and associated formatting built into common-currencies. An heroic piece of work - so much thanks to fueripe-desu from myself and the wider Dart community.

    Open source →
  33. 5.0.0-alpha.2 18 Feb 2024 pre-release
    Release notes
    • updated the list of supported platforms.
    Open source →
  34. 5.0.0-alpha.1 18 Feb 2024 pre-release
    Release notes

    The driver for this release and the breaking changes comes from: https://github.com/onepub-dev/money.dart/issues/79

    The aim is to allow users to fully customise the group and decimal separators. We have also renamed 'scale' to 'decimalDigits' as this term is likely to be more familiar to users.

    breaking changes

    • The 'invertSeparator' argument to the Currency class has been broken out into two separate arguments 'groupSeparator' and 'decimalSeparator'. If you are using 'invertSeparator: true' then you need to replace this with
      groupSeparator: '.',
      decimalSeparator: ',',
    
    • patterns used for parsing and formatting must always use ',' for group separators and '.' for decimal separators regardless of what has been used for the groupSeparator and decimalSeparator. This allows a single pattern to be used across currencies rather than having to create a unique pattern for each currency when looking to use custom formats.

    This means that if you have been using 'invertSeparator: true' then you will need to modifiy any custom patterns from '#.###,##' to '#,###.##'. Note the change in the separators!

    • For methods that take a 'code' it has been renamed 'isoCode' to make the correct use of the code more apparent.

    • renamed PatterDecoder.isCode to isIsoCode

    • renamed CurrencyCode to CurrencyIsoCode

    • renamed all occurances of 'scale' to 'decimalDigits' as many people are not familiar with the concept of scale.

    • changed toScale on ExchangeRate members to be 'toDecimalDigits'.

    non-breaking changes

    • Fixed doco for Currencies class as it is a singleton and it's needs methods need to be called via Currencies()...
    Open source →
  35. 4.1.0 17 Feb 2024
    Release notes
    • upgraded to intl 0.19
    Open source →
  36. 4.0.0 01 Aug 2023
    Release notes
    • updated min sdk to 3.x
    • updated to fixed 4.x
    • test: add test for trailing symbol pattern
    Open source →
  37. 3.4.1 28 Apr 2023
    Release notes
    • fix(pattern_encoder): handle trailing decimal when pattern has trailing symbol
    • Added scale unit tests provided by @nesquikm
    Open source →
  38. 3.4.0 13 Mar 2023
    Release notes
    • upgraded to: fixed 2.4.0, intl 0.18, meta 1.9.0
    Open source →
  39. 3.3.0 10 Sep 2022
    Release notes
    • Upgraded to fixed 2.3.0 and Decimal 2.3.0 to fixed a compilation problem caused by a breaking change in decimal. upgraded to lint_hard. Increased the minimum sdk to 2.14 as reflect decimals minimum sdk.
    Open source →
  40. 3.2.0 31 Aug 2022
    Release notes
    • updated to the latest version of decimal, fixed and meta.
    • BREAKING: The exchange rate formatter was incorrectly displaying the rate as a currency when its just a scalar value. The currency symbol prefix has now been removed. The exchange rate format was also performing rounding when the scale was larger than the no. of decimals the format included. This was not the intended behaviour. It now truncates the no. of decimals to reflect the format pattern. If you want rounding then you should scale the no. before formatting it.
    Open source →
  41. 3.1.4 25 Aug 2022
    Release notes
    • Fixed: #69 - tryParse throws when Money empty - thanks to LewisHolliday
    • add failing tryParse tests
    • add tests for parse with invalid input
    • Money.parse now correctly throws MoneyParseException when an invalid amount is passed.
    Open source →
  42. 3.1.3 04 Jun 2022
    Release notes
    • exported money_data.dart in the barrel file.
    • corrected spelling for Money.fromBigIntWitCurrency and ExchangeRate.fromFixedWitCurrency
    • updated links from noojee.dev to onepub.dev
    Open source →
  43. 3.1.3-beta.1 09 Feb 2022 pre-release

    Nothing published for this version

  44. 3.1.2 21 Dec 2021
    Release notes

    Corrected the home page link

    Open source →
  45. 3.1.0 20 Dec 2021
    Release notes
    • Merge pull request #59 from niklasbartsch/Upraded-to-the-latest-version-of-fixed
    • Fixes: error when using Money2 in a Flutter Web environment due to the reduced size of an int (53bits vs 64 bits).
    Open source →
  46. 3.0.0 27 Nov 2021

    Nothing published for this version

  47. 3.0.0-beta2 22 Nov 2021 pre-release
    Release notes
    • added notes on v2-v3 conversion.
    • Changed ExchangePlatform to work with ExchangeRate changes.
    • Added ctors to ExchangeRate for the supported data types.
    • Added a method to apply an inverse rate. Added the from Currency so it could be used in the ExchangePlatform and is fully self desribing.
    • Fixed the # char for decimal patterns as it was acting like the 0 char.
    • Made the Code and Symbol patterns optional.
    • renamed Money.from to Money.fromNum.
    • Added Money.fromIntWithCurrency.
    • Added Money.fromDecimal
    • Added operators for Money and Fixed operations.
    • Change all exceptions to be derived from a common MoneyException.
    • Updated bitcoins pattern to make it consistent with other currencies.
    • Added the exchange_platform to the set of exported classes.
    • Added decimalPart to moneyData.
    • Added sign to Money.
    Open source →
  48. 3.0.0-beta.6 30 Jul 2021 pre-release
    Release notes
    • Added additional tests for INR.
    • INR had invertseparator as true which isn't correct for INR. The pattern was also wrong.
    Open source →
  49. 3.0.0-beta.5 30 Jul 2021 pre-release
    Release notes

    Change the common currency format for the inr currencies as it was inconsistent with all other default formats. This also sides steps bug #50.

    Open source →
  50. 3.0.0-beta.4 18 Jul 2021 pre-release
    Release notes
    • reverted meta to 1.3 as flutter_test isn't compatible with meta 1.7 Fixes: #47
    Open source →
  51. 3.0.0-beta.3 17 Jul 2021 pre-release
    Release notes
    • upgraded to latest meta.
    • moved to lints package.
    • added [] and []= operators to access Currencies.
    • cleaned up package imports.
    Open source →
  52. 3.0.0-beta.2 16 Jul 2021 pre-release
    Release notes

    Revised the Money constructors to take a currency 'code' rather than a currency.

    Money.from(100, CommonCurrency.usd);
    
    becomes
    
    Money.from(100, 'USD');
    
    Old methods are still available as:
    
    Money.fromWithCurrency(100, CommonCurrency.usd);
    
    

    To support this CommonCurrencies are now automatically registered.

    Open source →
  53. 3.0.0-beta.1 16 Jul 2021 pre-release
    Release notes

    Breaking changes

    • re-implemented each of the == operator to use 'covariant' rather than taking a dynamic as this moves the type check to a compile time error rather than a runtime error. You can nolonger pass a dynamic to the == operator.
    • Changed the Currencies class to a singleton as per #38. You will need to change calls such as:
    Currencies.register() -> Currences().register();
    Currencies.registerAll() -> Currences().registerAll();
    Currencies.parse() -> Currences().parse();
    
    • restructured the unit test directory so it confirms to the recommended structure.
    Open source →
  54. 2.3.0 06 Nov 2021
    Release notes
    • In response to issue #53 we have modified how excess minorUnits (decimals) are parsed. Even if the parse pattern doesn't contain decimal places we will still parse decimal places in the Monetary Value. This ensures that we always retain the original parsed values precisions. However the api is currently quiet on how precision is treated when parsing decimals. We have now documented the api to state that we will parse upto the Currencies defined precisions.
      • This means: if you pass a monetary value with decimal digits in excess of the Currencies precision they will be ignored. If you pass a monetary value with decimal digits in excess of the passed pattern then they will be parsed upto the precision of the Currency.
    • Fixed a bug where parsing a no. of the form '.99' (i.e. no leading major digit) would thrown an exception.
    Open source →
  55. 2.2.3 03 Oct 2021

    Nothing published for this version

  56. 2.2.2 30 Sep 2021
    Release notes
    • Fix overflow issue when using high precision currencies - thanks to Bob Jackman for the contribution.
    Open source →
  57. 2.2.1 17 Jun 2021
    Release notes

    Improved documentation around the Currencies class.

    Open source →
  58. 2.2.0 16 Jun 2021
    Release notes
    • Add API to access currently registered currencies
    Iterator<Currency> Currencies.getRegistered()
    
    Open source →
  59. 2.1.4 11 Jun 2021
    Release notes

    replaced @deprecated with @Deprecated.

    Open source →
  60. 2.1.3 11 Jun 2021
    Release notes

    Updated links in readme.

    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