{"id":21848215,"url":"https://github.com/rettetdemdativ/dinero","last_synced_at":"2025-10-17T20:39:51.367Z","repository":{"id":57545342,"uuid":"88638849","full_name":"rettetdemdativ/dinero","owner":"rettetdemdativ","description":"💵 Foreign exchange rates package for Go","archived":false,"fork":false,"pushed_at":"2017-04-21T08:59:43.000Z","size":21,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T17:31:34.067Z","etag":null,"topics":["currencies","dinero","exchange","exchange-rates","foreign-exchange-rates","go","golang","library","money","package"],"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/rettetdemdativ.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}},"created_at":"2017-04-18T15:08:51.000Z","updated_at":"2018-01-20T13:09:52.000Z","dependencies_parsed_at":"2022-08-27T05:21:50.668Z","dependency_job_id":null,"html_url":"https://github.com/rettetdemdativ/dinero","commit_stats":null,"previous_names":["calmandniceperson/dinero"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rettetdemdativ/dinero","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rettetdemdativ%2Fdinero","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rettetdemdativ%2Fdinero/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rettetdemdativ%2Fdinero/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rettetdemdativ%2Fdinero/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rettetdemdativ","download_url":"https://codeload.github.com/rettetdemdativ/dinero/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rettetdemdativ%2Fdinero/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268690078,"owners_count":24291080,"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-04T02:00:09.867Z","response_time":79,"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":["currencies","dinero","exchange","exchange-rates","foreign-exchange-rates","go","golang","library","money","package"],"created_at":"2024-11-27T23:25:01.539Z","updated_at":"2025-10-17T20:39:51.266Z","avatar_url":"https://github.com/rettetdemdativ.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dinero\n\ndinero is a [Go](https://golang.org) package for fetching exchange rates and converting between currencies. It aims to provide a simple interface and uses [hippasus' ExchangeRates](https://github.com/hippasus/ExchangeRates) and [decimal](https://github.com/shopspring/decimal), which allows for higher precision when working with the values representing currency.\n\n[![Build Status](https://travis-ci.org/calmandniceperson/dinero.svg?branch=master)](https://travis-ci.org/calmandniceperson/dinero) [![Go Report Card](https://goreportcard.com/badge/github.com/calmandniceperson/dinero)](https://goreportcard.com/report/github.com/calmandniceperson/dinero) [![GoDoc](https://godoc.org/github.com/calmandniceperson/dinero?status.svg)](https://godoc.org/github.com/calmandniceperson/dinero)\n\n## Installation\n\n    go get github.com/calmandniceperson/dinero\n\n## Examples\n\n### Converting a value in one currency to another\n\n```go\na := Amount{Value: decimal.NewFromFloat(5.245), Currency: USD}\n// or\na := NewAmount(decimal.NewFromFloat(5.245), USD)\nres, _ := a.ConvertTo(EUR)\n// res contains the converted value as a decimal\n```\n\n### Creating an amount from a float\n\n```go\na := NewAmountFromFloat(5.232, EUR)\n```\n\n### Creating an amount from a string\n\n```go\na := NewAmountFromString(\"5423.65\", JPY)\n```\n\n### Creating a certain amount of a currency\n\n```go\nu := USD\na1 := u.Amount(decimal.NewFromFloat(25000))\na2 := u.AmountFromFloat(7300.32)\na3 := u.AmountFromString(\"200.09\")\n```\n\n### Printing an amount of a certain currency\n\n```go\na := Amount{decimal.NewFromFloat(450), JPY}\nprintln(a.String())\n```\n\n## Dependencies\n\n* [decimal](https://github.com/shopspring/decimal)\n\n### For testing\n\n* [testify](https://github.com/stretchr/testify)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frettetdemdativ%2Fdinero","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frettetdemdativ%2Fdinero","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frettetdemdativ%2Fdinero/lists"}