{"id":16352150,"url":"https://github.com/thudugala/money","last_synced_at":"2025-11-19T01:30:14.724Z","repository":{"id":183757766,"uuid":"670595504","full_name":"thudugala/Money","owner":"thudugala","description":"A Money class with multi-currency arithmetic for .Net (C#)","archived":false,"fork":false,"pushed_at":"2024-04-29T08:10:03.000Z","size":84,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-29T09:30:32.423Z","etag":null,"topics":["csharp","currency","money"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thudugala.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-25T12:01:52.000Z","updated_at":"2024-04-29T09:30:35.231Z","dependencies_parsed_at":"2024-02-20T08:27:45.430Z","dependency_job_id":"e6b8eb41-c9bc-4aa6-83a0-1d6467a34f88","html_url":"https://github.com/thudugala/Money","commit_stats":null,"previous_names":["thudugala/money"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thudugala%2FMoney","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thudugala%2FMoney/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thudugala%2FMoney/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thudugala%2FMoney/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thudugala","download_url":"https://codeload.github.com/thudugala/Money/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239619580,"owners_count":19669446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["csharp","currency","money"],"created_at":"2024-10-11T01:25:09.898Z","updated_at":"2025-11-19T01:30:14.583Z","avatar_url":"https://github.com/thudugala.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://raw.githubusercontent.com/thudugala/Money/main/Screenshots/icon.png\" width=\"128px\"/\u003e\n\n[![CI](https://github.com/thudugala/Money/actions/workflows/dotnet.yml/badge.svg)](https://github.com/thudugala/Money/actions/workflows/dotnet.yml)\n[![NuGet](https://img.shields.io/nuget/v/Thudugala.MultiCurrencyMoney.svg)](https://www.nuget.org/packages/Thudugala.MultiCurrencyMoney/) \n[![NuGet](https://img.shields.io/nuget/dt/Thudugala.MultiCurrencyMoney.svg)](https://www.nuget.org/packages/Thudugala.MultiCurrencyMoney/)\n\n# Money\nA Money class with multi-currency arithmetic for .Net (C#)\n\n## Usage\n\n### Money\n\n```cs\nvar m1 = new Money(0m, CurrencyCode.NZD);\n\n// When CurrencyCode is not specified.\n// CurrencyCode will default to GlobalSetting.DefaultCurrencyCode.\nvar m2 = new Money(0m);\n\n// When the amount and CurrencyCode are not specified.\n// The amount will default to zero, and CurrencyCode will default to GlobalSetting.DefaultCurrencyCode.\nvar m3 = new Money();\n\n// Money.Empty is the same as new Money()\nvar m4 = Money.Empty;\n\nvar m5 = Money.Parse(\"1.06 NZD\");\n```\n\n### CurrencyCode\n\nDefault CurrencyCode is GlobalSetting.DefaultCurrencyCode and can be changed\n\n```cs\nGlobalSetting.DefaultCurrencyCode = CurrencyCode.AUD\n```\nCurrencyCode class can be to be inherited and ad new currency codes if needed\n\n### ExchangeRate\n\nMoney can be multiplied by ExchangeRate and changed to different Currency\n\n```cs\nvar m1 = new Money(1m, CurrencyCode.USD);\nvar rate = new ExchangeRate(CurrencyCode.USD, CurrencyCode.NZD, 1.6m, DateTime.Today);\n\nvar result = m1 * rate;\nAssert.Equal(new Money(1.6m, CurrencyCode.NZD), result);\n```\n\n## Rules\n\n1. Money can only be added or Subtract using the same currency Money\n2. Money can only be multiplied using decimal or ExchangeRate\n3. Money can only be divided and checked remainder using decimal\n\n## Thank you\n- Thank you for the Icons by [Paomedia](https://www.iconfinder.com/paomedia)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthudugala%2Fmoney","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthudugala%2Fmoney","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthudugala%2Fmoney/lists"}