{"id":21707331,"url":"https://github.com/marchdev-tk/mdmoney","last_synced_at":"2026-04-08T22:31:44.194Z","repository":{"id":164936782,"uuid":"640352988","full_name":"marchdev-tk/mdmoney","owner":"marchdev-tk","description":"march.dev money library. Provides a new way to work with a money. From highly flexible creation to rich data manipulation and stringification options.","archived":false,"fork":false,"pushed_at":"2025-03-11T14:47:42.000Z","size":128,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-05T03:03:52.101Z","etag":null,"topics":["android","dart","dart-package","dart3","dartlang","flutter","flutter-desktop","flutter-mobile","flutter-package","flutter-plugin","flutter-web","ios","linux","macos","money","package","plugin","web","windows"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marchdev-tk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-13T19:58:37.000Z","updated_at":"2025-05-07T15:14:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"71d93517-afb3-4121-9659-72c21c6bcda7","html_url":"https://github.com/marchdev-tk/mdmoney","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":"marchdev-tk/dart_package_template","purl":"pkg:github/marchdev-tk/mdmoney","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marchdev-tk%2Fmdmoney","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marchdev-tk%2Fmdmoney/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marchdev-tk%2Fmdmoney/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marchdev-tk%2Fmdmoney/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marchdev-tk","download_url":"https://codeload.github.com/marchdev-tk/mdmoney/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marchdev-tk%2Fmdmoney/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31577444,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","dart","dart-package","dart3","dartlang","flutter","flutter-desktop","flutter-mobile","flutter-package","flutter-plugin","flutter-web","ios","linux","macos","money","package","plugin","web","windows"],"created_at":"2024-11-25T22:17:06.650Z","updated_at":"2026-04-08T22:31:44.173Z","avatar_url":"https://github.com/marchdev-tk.png","language":"Dart","readme":"# mdmoney\n\n![Build](https://github.com/marchdev-tk/mdmoney/workflows/build/badge.svg)\n[![codecov](https://codecov.io/gh/marchdev-tk/mdmoney/branch/master/graph/badge.svg)](https://codecov.io/gh/marchdev-tk/mdmoney)\n[![Pub](https://img.shields.io/pub/v/mdmoney.svg)](https://pub.dartlang.org/packages/mdmoney)\n![GitHub](https://img.shields.io/github/license/marchdev-tk/mdmoney)\n![GitHub stars](https://img.shields.io/github/stars/marchdev-tk/mdmoney?style=social)\n\nmarch.dev money library. Provides a new way to work with a money. From highly flexible creation to rich data manipulation and stringification options.\n\n## Getting Started\n\nTo begin your work with a money object you need to create it, there are several ways to do it:\n\n  * `Money.fromCents` with following args:\n    * `cents`\n    * `currency`\n    * custom `precision`, if not provided - `currency.precision` will be used instead\n  * `Money.fromBigInt` with following args:\n    * `BigInt` amount\n    * `currency`\n    * custom `precision`, if not provided - `currency.precision` will be used instead\n  * `Money.fromInt` with following args:\n    * `int` amount\n    * `currency`\n    * custom `precision`, if not provided - `currency.precision` will be used instead\n  * `Money.fromDecimal` with following args:\n    * `Decimal` amount (from `decimal` package)\n    * `currency`\n    * custom `precision`, if not provided - `currency.precision` will be used instead\n  * `Money.fromDouble` with following args:\n    * `double` amount\n    * `currency`\n    * custom `precision`, if not provided - `currency.precision` will be used instead\n  * `Money.fromString` with following args:\n    * `String`\n    * `currency`, if not specified in a `String`\n    * custom `precision`, if not provided - `currency.precision` will be used instead\n  * `Money.fromAmount` with following args:\n    * `Amount` amount\n    * `currency`\n    * custom `precision`, if not provided - `amount.precision` will be used instead\n    * `preferCurrencyPrecision`, if set to `true` field `precision` is omitted, otherwise either `precision` or `amount.precision` will be used.\n\nAlso there are some convenient ways to create an object:\n\n  * `Money.zeroOf` to create the amount with `0` as numerator with following args:\n    * `currency`\n    * custom `precision`, if not provided - `currency.precision` will be used instead\n  * `Money.oneOf` to create the amount with `1` as numerator with following args:\n    * `currency`\n    * custom `precision`, if not provided - `currency.precision` will be used instead\n  * `Money.oneIntOf` to create the amount with `1` as integer with following args:\n    * `currency`\n    * custom `precision`, if not provided - `currency.precision` will be used instead\n  * `Money.zero` to create the amount with `0` as numerator in default currency (`FiatCurrency.$default`)\n  * `Money.one` to create the amount with `1` as numerator in default currency (`FiatCurrency.$default`)\n  * `Money.oneInt` to create the amount with `1` as integer in default currency (`FiatCurrency.$default`)\n\nFirst of all, `Money` object is `comparable` and has all required operators:\n  * unary `operator -`\n  * binary `operator -`\n  * `operator +`\n  * `operator *`\n  * `operator /`\n  * `operator \u003c`\n  * `operator \u003c=`\n  * `operator \u003e`\n  * `operator \u003e=`\n  * `operator ==`\n\nRegarding what you can do with this object, let's break down following methods/getters/fields:\n  \n  * `cents` - returns the `BigInt` `cents` representation of the amount \n  * `currency` - returns the `currency` of the amount\n  * `precision` - returns the `precision` of the amount (quantity of digits in fractional part)\n  * `sign` - returns the `sign` of the amount\n  * `isEven` - whether the amount is `even` or not\n  * `isOdd` - whether the amount is `odd` or not\n  * `isNegative` - whether the amount is `negative` or not\n  * `isPositive` - whether the amount is `positive` or not\n  * `isZero` - whether the amount is equals to `zero` or not\n  * `isGreaterThanZero` - whether the amount is greater than `zero` or not\n  * `isGreaterThanOrEqualZero` - whether the amount is greater than or equals to `zero` or not\n  * `isLessThanZero` - whether the amount is less than `zero` or not\n  * `isLessThanOrEqualZero` - whether the amount is less than or equals to `zero` or not\n  * `integer` - returns the `integer` part of the amount\n  * `fractional` - returns the `fractional` part of the amount in `BigInt` cents\n  * `fractionalDecimal` - returns the `fractional` part of the amount in `Decimal`\n  * `fractionalDouble` - returns the `fractional` part of the amount in `double`\n  * `abs` - returns the `absolute` (always positive) amount\n  * `round` - returns the `rounded` amount\n  * `ceil` - returns the `ceiled` amount (rounded to the next integer)\n  * `floor` - returns the `floored` amount (truncating fractional part of the amount)\n  * `toDecimal` - returns the amount in `Decimal`\n  * `toDouble` - returns the amount in `double`\n  * `toAmount` - returns the amount in `Amount`\n  * `toString` - return the `String` representation of the amount with lots of customisation options, they are:\n    * `DecimalSeparatorFormat` - specifies which decimal separator to use:\n      * `point`\n      * `comma` \n    * `RankFormat` - specifies rank formatting:\n      * `none` (`XXXX`)\n      * `space` (`X XXX`)\n    * `AmountFormat` - specifies amount display formatting:\n      * `integer` - only integer part (`XXXX`)\n      * `flexibleDouble` - fractional parts will not display trailing zeros (`XXXX`/`XXXX.X`/`XXXX.XX`)\n      * `fixedDouble` - fractional parts will display full precision, even zeros (`XXXX.XX`)\n    * `FiatCurrencyFormat` - specifies how currency should be displayed:\n      * `none`\n      * `code` (`USD`/`EUR`/`UAH`/etc.)\n      * `icon` (`$`/`€`/`₴`/etc.)\n    * `CurrencyPosition` - specifies where currency should be:\n      * `start`\n      * `startSpaced`\n      * `end`\n      * `endSpaced`\n      * `decimalSeparator`\n    * `precision` - if set, this method will behave differently based on `AmountFormat`:\n      * `integer` - `precision` is omitted\n      * `fixedDouble` - `precision` will be used as an override to `Amount.precision`\n      * `flexibleDouble` - `precision` will be used only if length of fractionals will be less than `precision`\n\n### Known limitations\n\n  * Max precision is `15`, everything that is beyond this precision will be trimmed due to Decimal's internal inability to work with such precisions.\n\n## Examples\n\nTo see usage example navigate to the [Example](example/README.md) section.\n\n## Feature requests and Bug reports\n\nFeel free to post a feature requests or report a bug [here](https://github.com/marchdev-tk/mdmoney/issues).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarchdev-tk%2Fmdmoney","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarchdev-tk%2Fmdmoney","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarchdev-tk%2Fmdmoney/lists"}