{"id":13551608,"url":"https://github.com/fadhly-permata/flutter_money_formatter","last_synced_at":"2026-02-27T00:31:58.728Z","repository":{"id":48308560,"uuid":"169877672","full_name":"fadhly-permata/flutter_money_formatter","owner":"fadhly-permata","description":"\"FlutterMoneyFormatter\" is a Flutter extension to formatting various types of currencies according to the characteristics you like, without having to be tied to any localization.","archived":false,"fork":false,"pushed_at":"2024-04-20T22:36:28.000Z","size":2366,"stargazers_count":85,"open_issues_count":22,"forks_count":124,"subscribers_count":3,"default_branch":"dev","last_synced_at":"2025-10-23T07:29:54.172Z","etag":null,"topics":["compact","flutter","flutter-package","formatter","money","money-formatter","money-library","money-package"],"latest_commit_sha":null,"homepage":"https://pub.dartlang.org/packages/flutter_money_formatter","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fadhly-permata.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-09T14:55:52.000Z","updated_at":"2024-05-25T20:04:42.000Z","dependencies_parsed_at":"2024-03-30T05:32:33.590Z","dependency_job_id":"2ddfacdd-f385-4258-abee-2528e2b464fa","html_url":"https://github.com/fadhly-permata/flutter_money_formatter","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/fadhly-permata/flutter_money_formatter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadhly-permata%2Fflutter_money_formatter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadhly-permata%2Fflutter_money_formatter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadhly-permata%2Fflutter_money_formatter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadhly-permata%2Fflutter_money_formatter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fadhly-permata","download_url":"https://codeload.github.com/fadhly-permata/flutter_money_formatter/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadhly-permata%2Fflutter_money_formatter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29878995,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T23:51:21.483Z","status":"ssl_error","status_checked_at":"2026-02-26T23:50:46.793Z","response_time":89,"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":["compact","flutter","flutter-package","formatter","money","money-formatter","money-library","money-package"],"created_at":"2024-08-01T12:01:51.133Z","updated_at":"2026-02-27T00:31:58.702Z","avatar_url":"https://github.com/fadhly-permata.png","language":"Dart","funding_links":[],"categories":["Dart"],"sub_categories":[],"readme":"# FlutterMoneyFormatter\n\n\n\u003e `FlutterMoneyFormatter` is a [Flutter](https://flutter.io) extension to formatting various types of currencies according to the characteristics you like, without having to be tied to any localization.\n\u003e\n\u003e [![latest version](https://img.shields.io/pub/v/flutter_money_formatter.svg?style=plastic\u0026logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAQAAAC1QeVaAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAHdElNRQfjAg8HMDMbfsHaAAABSUlEQVQY0y2LsUvUYRyHn+/7fe2uVMIz4hcnin+BFCrdZq1BQ1MN4VJxY7MoRLg7OGQ0NPkfiIOYBbYpiUO0VSQ15UFxHHf8fu/7cTif9XkeEz/54TO5qX4xtmJP8mZ8vR+vpt/q4gU3QitP3Iwr9fdhyerhPjZ7cBZH9Rf75ldSp11tXKsnZYHlEDvrt9dO4/dkjwjF6tde43M5GjGBlGoxrNtainGOsef9RqsMIyfUEZg8V1pVslf+crL3dup6EW6ZOMMRGEbmnmqh07bpkLEB89xhgMFQo8dRy4AZMGAe+EINkAEp2B6QhvHw7nOJ+9Fuq2guNsvKDaNiBvGLkUTQuf8Pd3e6U+MLKnGAkmkyf8xN/+zAeuFBKt+FZ6qGmux+tP3xw0TFGz7ZoffRlqQkSSolvRCK8Skmz9lpE3lIl0CiUfUix34BalOOAMgIffsAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTktMDItMTVUMDc6NDg6NTEtMDU6MDCMNC56AAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE5LTAyLTE1VDA3OjQ4OjUxLTA1OjAw/WmWxgAAAABJRU5ErkJggg==)](https://pub.dartlang.org/packages/flutter_money_formatter)\n\u003e [![last commit](https://img.shields.io/github/last-commit/fadhly-permata/flutter_money_formatter.svg?logo=github\u0026style=plastic)](https://github.com/fadhly-permata/flutter_money_formatter)\n\u003e [![License](https://img.shields.io/badge/license-BSD-blue.svg?style=plastic\u0026logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAMAAAAolt3jAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAACPVBMVEXLy9UAAADLy9Tn7ubo7+bh5+Lb397b397i6OLc4N/f4+Df5ODc4N/i5+Li5+Lk6ePj6ePf4uAAAFbo7ubn7uU5F3re4eDw9+ru9unk6uTu9unOztbLy9XQ0NfMzNXKydTLytXLytTKydPMzNXPz9fNzdbIyNPY29zZ3N3Z3N3Y29zb397b397Y29zZ3N3Z3N3Y29zIyNPNzdW/vM3Y29zc4N/c4N/c4N/c4N/c4N/c4N/c4N/c39/c4N/X29zAvM3b397c4N/b397b3t7b397b397b39/b397b3t7b39/c4N/b397b39/b397b39/a3t7c4N/c4N/a3t7b397b397b39/b39/b39/b39/b397b4N7b39/b397b39/b39/b397c4N/b397b397b397c4N/U19vb4N7b39/U1tvc4N/b397b397b397c4N/c4N/c4N/b397b4N7b39/b39/c4N/c4N/a3d7b397b397b397a3d7b4N7b39/a3d7b397b397b397a3d7T1NnU1trQ0dfb4N7b39/Q0dfU1trT1NnQ0dfT1NnR09jT1drT1drb4N7b39/T1trU1trR09jT1dnQ0NfNztbR0tjb397c4N/c4N/c4N/c4N/c4N/b39/NztbHx9LPz9fNzdXP0Nfb397b397b397b397b397b397b397b397FxNHJydTOztbPz9fMzNXNzdbOztbOztbLy9XLy9XNzdXMzNXPz9fc4N/c4N/c4N/c4N/c4N////9bn80kAAAAuXRSTlMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMEAQAAAQQDBAQRGBYQZ2cQFhgRBAQCC9T7+vr///r71AsCI+pwN0Hg4EE3cOsjlE+PBdbVBY5PlVxvZWfa2WdlcFvKXVFYwAjU0wjAWFFdy7D7sNfXsfuwC3u7gxDX1hCDu3sLAwAE1tUEAAMECAYGCNPSCAYGCAQDBqrv/f3x/MsEAwQEBmihl5OTmJ98AwQEAwQEAQAAAAMEAzPoO4QAAAABYktHRL6k3IPDAAAAB3RJTUUH4wIPByY17oXROAAAAN1JREFUCNcB0gAt/wAdHh8AIAEBAQEhAiIjJAAlJicoKSorLC0uLzAxMgAzNDU2Nzg5Ojs3PD0+PwADQEFCQ0RFRkdISUpLBAAFTE1OTwZQUQdSU1RVCABWVwlYWQpaWwtcXQxeXwBgYWJjZGVmZ2hpamtsbQBuuW+6cA1xcg5zu3S8dQB2d3h5eg97fBB9fn+AgQCCEYMShBOFhhSHFYgWiQCKi4yNjhePkBiRkpOUlQCWlxmYvZmam5ydnp+goQCioxqkpaanqKmqq6ytrgCvsLGyG7MBAbQctba3uPQxRmBOIi5hAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE5LTAyLTE1VDA3OjM4OjUzLTA1OjAwMpAq0AAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxOS0wMi0xNVQwNzozODo1My0wNTowMEPNkmwAAAAASUVORK5CYII=)](https://raw.githubusercontent.com/fadhly-permata/flutter_money_formatter/master/LICENSE)\n\n#### Dependencies :\n[![intl](https://img.shields.io/pub/vpre/intl.svg?label=intl\u0026colorA=gray\u0026colorB=green\u0026style=plastic)](https://pub.dartlang.org/packages/intl)\n\n\n### Screenshot\n![screenshot](doc/fmf.gif)\n\n---\n\n\n## Install\n\nFor complete steps in installing `FlutterMoneyFormatter` you can see in the [**Installation Guide**](https://pub.dartlang.org/packages/flutter_money_formatter#-installing-tab-).\n\n\n## Usage\n\nImport the library\n\n```dart\nimport 'package:flutter_money_formatter/flutter_money_formatter.dart';\n```\n\n\n## Getting Started\n\nTo be able to format your `double` value into the various formats you want, you first need to create a `FlutterMoneyFormatter` instance like the following:\n\n\n```dart\nFlutterMoneyFormatter fmf = FlutterMoneyFormatter(\n    amount: 12345678.9012345\n);\n```\n\n\u003e Note, the code above still uses the default configuration as [explained here](#configurations).\n\nAfter that, you can request various results of the format as follows:\n\n```dart\n// normal form\nprint(fmf.output.nonSymbol); // 12,345,678.90\nprint(fmf.output.symbolOnLeft); // $ 12,345,678.90\nprint(fmf.output.symbolOnRight); // 12,345,678.90 $\nprint(fmf.output.fractionDigitsOnly); // 90\nprint(fmf.output.withoutFractionDigits); // 12,345,678\n\n// compact form\nprint(fmf.output.compactNonSymbol) // 12.3M\nprint(fmf.output.compactSymbolOnLeft) // $ 12.3M\nprint(fmf.output.compactSymbolOnRight) // 12.3M $\n```\n\nIf you will use the output format several times, I strongly recommend that you initialize a variable as in the following example:\n\n```dart\nMoneyFormatterOutput fo = fmf.output;\n```\n\nOr directly when initializing the `FlutterMoneyFormatter` instance as in the following example:\n\n```dart\nMoneyFormatterOutput fo = FlutterMoneyFormatter(\n    amount: 12345678.9012345\n).output;\n```\n\nSo you can immediately take the value more easily as in the following example:\n\n```dart\n// normal form\nprint(fo.nonSymbol); // 12,345,678.90\nprint(fo.symbolOnLeft); // $ 12,345,678.90\nprint(fo.symbolOnRight); // 12,345,678.90 $\nprint(fo.fractionDigitsOnly); // 90\nprint(fo.withoutFractionDigits); // 12,345,678\n\n// compact form\nprint(fo.compactNonSymbol) // 12.3M\nprint(fo.compactLeftSymbol) // $ 12.3M\nprint(fo.compactRightSymbol) // 12.3M $\n```\n\nSee [demo section](#demo) to get more info.\n\n## Configurations\n\nTo adjust the format to suit your needs, you can set it through the `settings` parameter:\n\n```dart\nFlutterMoneyFormatter fmf = new FlutterMoneyFormatter(\n    amount: 12345678.9012345,\n    settings: MoneyFormatterSettings(\n        symbol: 'IDR',\n        thousandSeparator: '.',\n        decimalSeparator: ',',\n        symbolAndNumberSeparator: ' ',\n        fractionDigits: 3,\n        compactFormatType: CompactFormatType.sort\n    )\n)\n```\n\nOf course you are not required to initialize the entire configuration in the `settings` (`MoneyFormatterSettings`) parameter as in the example above. You can change one or more of the configurations above. This is because each configuration above is not mandatory and has a default value.\n\n---\n\n## Properties, Methods, and Functions\n\n- ## `FlutterMoneyFormatter`\n\n| Property Names    | Data Type                 | Descriptions |\n| ----------------- | ------------------------- | ------------ |\n| `amount`          | `double`                  | Amount number that will be formatted. |\n| `settings`        | `MoneyFormatterSettings`  | [See here.](#MoneyFormatterSettings) |\n| `output`          | `MoneyFormatterOutput`    | [See here.](#MoneyFormatterOutput) |\n| `comparator`      | `MoneyFormatterCompare`   | [See here.](#MoneyFormatterCompare) |\n| `copyWith`        | `FlutterMoneyFormatter`   | [see here](#duplicating-instance) |\n| `fastCalc`        | `FlutterMoneyFormatter`   | [see here](#FastCalc) |\n\n\n- ## `MoneyFormatterSettings`\n\n| Configuration Property        | Data Type             | Default Value             | Description   |\n| ----------------------------- | --------------------- | ------------------------- | ------------- |\n| `symbol`                      | `String`              | `$` (Dollar Sign)         | The symbol that will be used on formatted output. |\n| `thousandSeparator`           | `String`              | `,`                       | The character that will be used as thousand separator on formatted output. |\n| `decimalSeparator`            | `String`              | `.`                       | The character that will be used as decimal separator on formatted output. |\n| `fractionDigits`              | `int`                 | `2`                       | The fraction digits that will be used on formatted output. |\n| `symbolAndNumberSeparator`    | `String`              | `' '` (Space)             | The character that will be used as separator between formatted number and currency symbol. |\n| `compactFormatType`           | `CompactFormatType`   | `CompactFormatType.short` | [See here.](#CompactFormatType) |\n\n\n- ## CompactFormatType\n\nYou can change the type of compact format like for million using `M` or `million`, or trillion using `T` or `trillion`. and so on. This type only supports two type as described below:\n\n| Value                         | Description |\n| ----------------------------- | ---------- |\n| `CompactFormatType.short`     | Used to make the compact format displayed using short text. |\n| `CompactFormatType.long`      | Used to make the compact format displayed using long text. |\n\n\n- ## `MoneyFormatterOutput`\n\nYou can use formats that match your needs through properties found in the `MoneyFormatterOutput` instance.\n\n| Property Names            | Data Type | Descriptions |\n| ------------------------- | --------- | ------------ |\n| `nonSymbol`               | `String`  | The results of the format of the currency are normal and without a currency symbol. Example: 12,345,678.90 |\n| `symbolOnLeft`            | `String`  | The results of the normal currency format and with currency symbols are on the left. Example: $ 12,345,678.90 |\n| `symbolOnRight`           | `String`  | The results of the normal currency format and with currency symbols are on the right. Example: 12,345,678.90 $ |\n| `compactNonSymbol`        | `String`  | The results of the currency format are compact and without a currency symbol. Example: 12.3M |\n| `compactSymbolOnLeft`     | `String`  | The results of the currency format are compact and with currency symbols on the left. example: $ 12.3M |\n| `compactSymbolOnRight`    | `String`  | The results of the currency format are compact and with currency symbols on the right. example: 12.3M $ |\n| `fractionDigitsOnly`      | `String`  | Only give the fraction value. Example: 90 |\n| `withoutFractionDigits`   | `String`  | Give a value without fractions. Example: 12,345,678 |\n\n- ## `MoneyFormatterCompare`\n\n| Method                    | Parameter         | Descriptions |\n| ------------------------- | ----------------- | ------------ |\n| `isLowerThan`             | `amount`          | Check current instance-amount is lower than [amount] or not.  |\n| `isGreaterThan`           | `amount`          | Check current instance-amount is greater than [amount] or not. |\n| `isEqual`                 | `amount`          | Check current instance amount is equal than [amount] or not. |\n| `isEqualOrLowerThan`      | `amount`          | Check current instance amount is equal or lower than [amount] or not. |\n| `isEqualOrGreaterThan`    | `amount`          | Check current instance amount is equal or greater than [amount] or not. |\n\nExample of using a comparator:\n\n```dart\nFlutterMoneyFormatter fmf = FlutterMoneyFormatter(amount: 12345678.9012345);\ndouble comparerValue = 5678.9012;\n\nprint(fmf.comparator.isEqual(comparerValue)); // false\nprint(fmf.comparator.isGreaterThan(comparerValue)); // true\n\n```\n\n---\n\n## FastCalc\n\n`fastCalc` is a function that can be used to perform various fast calculation processes that you might need. In implementing it, the `fastCalc` function gives the output of a` FlutterMoneyFormatter` instance so you can perform several calculation functions at once with the chaining method.\n\n**Function**:\n\n```dart\nFlutterMoneyFormatter fastCalc({\n    @required FastCalcType type, \n    @required double amount\n})\n```\n\n**Implementation**:\n\n```dart\nFlutterMoneyFormatter fmf = FlutterMoneyFormatter(amount: 12345.678);\nfmf.fastCalc(type: FastCalcType.addition, amount: 1.111);\nfmf.fastCalc(type: FastCalcType.substraction, amount: 2.222);\n\nprint(fmf.output.nonSymbol); // 12,345.68\n```\n\nBecause it supports the chaining process, the example above can be shortened as follows:\n\n```dart\nFlutterMoneyFormatter fmf = FlutterMoneyFormatter(amount: 12345.678)\n    .fastCalc(type: FastCalcType.addition, amount: 1.111)\n    .fastCalc(type: FastCalcType.substraction, amount: 2.222);\n\nprint(fmf.output.nonSymbol);  // 12,345.68\n```\n\nThe `type` parameter used by the `fastCalc` function has the `FastCalcType` data type which is an enum. The following table is an explanation for the `FastCalcType` enum:\n\n| Index | Name                      | Description |\n| ----- | ------------------------- | ----------- |\n| 0     | addition                  | Used to do addition calculations. |\n| 1     | substraction              | Used to do substraction calculations. |\n| 2     | multiplication            | Used to do multiplication calculations. |\n| 3     | division                  | Used to do division calculations. |\n| 4     | percentageAddition        | Used to do the addition calculations base on percentage. |\n| 5     | percentageSubstraction    | Used to do the substraction calculations base on percentage. |\n\n\n---\n\n## Duplicating Instance\n\nFor some reasons, you may need to duplicate the `instance` and just need to change some configurations. To do that, you can use the `copyWith` method as below:\n\n```dart\nFlutterMoneyFormatter fmf = FlutterMoneyFormatter(amount: 12345678.9012345);\n\nprint(fmf.output.symbolOnLeft); // $ 12,345,678.90\nprint(fmf.copyWith(symbol: 'IDR', symbolAndNumberSeparator: '-').output.symbolOnLeft); // IDR-12,345,678.90\n```\n\n---\n\n## Demo\n\nFor more complete samples, you can grab it from the [example directory](https://github.com/fadhly-permata/flutter_money_formatter/tree/master/example).\n\n## Our Other Package\n\nSee our [other packages here](https://pub.dartlang.org/flutter/packages?q=email%3Afadhly.permata%40gmail.com).\n\n## Help Me\n\nIf you find some issues or bugs, please [report here.](https://github.com/fadhly-permata/flutter_money_formatter/issues/new?assignees=\u0026labels=\u0026template=bug_report.md\u0026title=) You can also help in [requesting new features here.](https://github.com/fadhly-permata/flutter_money_formatter/issues/new?assignees=\u0026labels=\u0026template=feature_request.md\u0026title=)\n\n## ChangeLog\n\nAre you curious about the changes that occur in each version? [See here for detailed informations](https://pub.dartlang.org/packages/flutter_money_formatter#-changelog-tab-).\n\n\n## Contributors\n| Name | Links |\n| ---- | ----- |\n| Fadhly Permata | [https://github.com/fadhly-permata](https://github.com/fadhly-permata) |\n| Gerrel | [https://github.com/Gerrel](https://github.com/Gerrel) |\n| ...you... | ...your link... |\n\n\n## LICENSE\n```text\nCopyright (c) 2019, Fadhly Permata \u003cfadhly.permata@gmail.com\u003e\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nThe views and conclusions contained in the software and documentation are those\nof the authors and should not be interpreted as representing official policies,\neither expressed or implied, of the 'FlutterMoneyFormatter' project.\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffadhly-permata%2Fflutter_money_formatter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffadhly-permata%2Fflutter_money_formatter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffadhly-permata%2Fflutter_money_formatter/lists"}