{"id":20096351,"url":"https://github.com/nomad-software/mongo","last_synced_at":"2025-08-08T10:37:41.781Z","repository":{"id":57570175,"uuid":"345145054","full_name":"nomad-software/mongo","owner":"nomad-software","description":"A straightforward money library for Go","archived":false,"fork":false,"pushed_at":"2023-02-27T19:06:22.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-19T15:52:12.960Z","etag":null,"topics":["currency","go","golang","money"],"latest_commit_sha":null,"homepage":"","language":"Go","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/nomad-software.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2021-03-06T16:48:39.000Z","updated_at":"2022-04-08T18:42:03.000Z","dependencies_parsed_at":"2024-06-20T12:05:21.622Z","dependency_job_id":"8708f510-0511-40d4-b51e-5b9b50038aff","html_url":"https://github.com/nomad-software/mongo","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/nomad-software/mongo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nomad-software%2Fmongo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nomad-software%2Fmongo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nomad-software%2Fmongo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nomad-software%2Fmongo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nomad-software","download_url":"https://codeload.github.com/nomad-software/mongo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nomad-software%2Fmongo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269409447,"owners_count":24412140,"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","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["currency","go","golang","money"],"created_at":"2024-11-13T16:58:35.369Z","updated_at":"2025-08-08T10:37:41.715Z","avatar_url":"https://github.com/nomad-software.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mongo\n\n**A straightforward money library for Go**\n\n---\n\n## Overview\n\nMongo is a straightforward money library for Go that makes it easy to handle the\nusually bug prone arithmetic when dealing with money.\n\n## Documentation\n\nhttps://pkg.go.dev/github.com/nomad-software/mongo@master#section-documentation\n\n## Example 1\n\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/nomad-software/mongo\"\n)\n\nfunc main() {\n\n\tm, err := mongo.MoneyGBP(1055)\n\n\tif err != nil {\n\t\tlog.Fatal(\"Error occured creating money\")\n\t}\n\n\tfmt.Printf(\"Money: %s\\n\", m)\n\n\tshares := m.Split(3)\n\tfmt.Printf(\"Shares: %s\\n\", shares)\n\n\tshares = m.Allocate(1, 2, 3)\n\tfmt.Printf(\"Allocations: %s\\n\", shares)\n\n\tjson, _ := json.Marshal(m)\n\tfmt.Println(string(json))\n}\n```\n\n### Output\n\n```\nMoney: £10.55\nShares: [£3.52 £3.52 £3.51]\nAllocations: [£1.76 £3.52 £5.27]\n{\"currency\":\"GBP\",\"amount\":\"£10.55\"}\n```\n\n## Example 2\n\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/nomad-software/mongo\"\n)\n\nfunc main() {\n\n\tm, err := mongo.PriceGBP(1055, 17.5)\n\n\tif err != nil {\n\t\tlog.Fatal(\"Error occured creating price\")\n\t}\n\n\tfmt.Printf(\"Price: %s\\n\", m)\n\n\tjson, _ := json.Marshal(m)\n\tfmt.Println(string(json))\n}\n```\n\n### Output\n\n```\nPrice: £10.55\n{\"currency\":\"GBP\",\"gross\":\"£10.55\",\"net\":\"£8.98\",\"tax\":{\"total\":\"£1.57\",\"detail\":[{\"amount\":\"£1.57\",\"description\":\"VAT\"}]}}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnomad-software%2Fmongo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnomad-software%2Fmongo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnomad-software%2Fmongo/lists"}