{"id":13894195,"url":"https://github.com/RobTillaart/Currency","last_synced_at":"2025-07-17T09:31:13.266Z","repository":{"id":45409379,"uuid":"342948227","full_name":"RobTillaart/Currency","owner":"RobTillaart","description":"Arduino library to display currency","archived":false,"fork":false,"pushed_at":"2024-04-13T08:57:28.000Z","size":25,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-19T06:33:18.416Z","etag":null,"topics":["arduino","currency","formatting"],"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/RobTillaart.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"RobTillaart","custom":"https://www.paypal.me/robtillaart"}},"created_at":"2021-02-27T20:09:31.000Z","updated_at":"2023-10-19T09:58:50.000Z","dependencies_parsed_at":"2024-11-19T06:41:21.899Z","dependency_job_id":null,"html_url":"https://github.com/RobTillaart/Currency","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobTillaart%2FCurrency","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobTillaart%2FCurrency/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobTillaart%2FCurrency/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobTillaart%2FCurrency/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RobTillaart","download_url":"https://codeload.github.com/RobTillaart/Currency/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226248197,"owners_count":17595158,"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":["arduino","currency","formatting"],"created_at":"2024-08-06T18:01:26.224Z","updated_at":"2024-11-24T23:30:15.122Z","avatar_url":"https://github.com/RobTillaart.png","language":"C++","funding_links":["https://github.com/sponsors/RobTillaart","https://www.paypal.me/robtillaart"],"categories":["C++"],"sub_categories":[],"readme":"\n[![Arduino CI](https://github.com/RobTillaart/currency/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)\n[![Arduino-lint](https://github.com/RobTillaart/currency/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/currency/actions/workflows/arduino-lint.yml)\n[![JSON check](https://github.com/RobTillaart/currency/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/currency/actions/workflows/jsoncheck.yml)\n[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/currency.svg)](https://github.com/RobTillaart/currency/issues)\n\n[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/currency/blob/master/LICENSE)\n[![GitHub release](https://img.shields.io/github/release/RobTillaart/currency.svg?maxAge=3600)](https://github.com/RobTillaart/currency/releases)\n[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/currency.svg)](https://registry.platformio.org/libraries/robtillaart/currency)\n\n\n# Currency\n\nArduino library to help formatting integers for printing as currency.\n\n\n## Description\n\n**Experimental**\n\nThe currency library contains a number of functions that help to print \nintegers as currency.\n\nThe currency functions assume you do the currency math in integer units.\nFor dollars and euro's this would be cents. For numbers with more decimals \nit is a smaller unit. \n\nUsing integers makes addition, subtraction and multiplication of currency exact.\n\nThe library has experimental wrappers for float/double values. \nNot tested extensively yet.\n\nChoosing int32_t as 'base' also means that there is a limit in terms \nof minimum and maximum values. When large amounts are needed one can \nuse the currency64() or one of its derived formatters as this is based\nupon int64_t numbers.\n\nThere is a relation with the printHelpers class - https://github.com/RobTillaart/printHelpers\nWhen this currency library has matured it might be merged with printHelpers.\n\n\n#### Related\n\n- https://github.com/RobTillaart/printHelpers\n\n## Interface\n\n```cpp\n#include \"currency.h\"\n```\n\nThe following functions are implemented:\n\n### Core function\n\n- **char \\* currency(int32_t value, uint8_t decimals, char decimalSeparator, char thousandSeparator, char symbol);** \n- **char \\* currency64(int64_t value, uint8_t decimals, char decimalSeparator, char thousandSeparator, char symbol);**\n\n\n### int32 Wrapper functions\n\n- **char \\* bitcoin(int32_t value)**\n- **char \\* dollar(int32_t value)**\n- **char \\* euro(int32_t value)**\n- **char \\* pound(int32_t value)**\n- **char \\* roubles(int32_t value)**\n- **char \\* yen(int32_t value)**\n- **char \\* yuan(int32_t value)**\n\n\n### int64 Wrapper functions\n\n- **char \\* bitcoin64(int64_t value)**\n- **char \\* dollar64(int64_t value)**\n- **char \\* euro64(int64_t value)**\n- **char \\* pound64(int64_t value)**\n- **char \\* roubles64(int64_t value)**\n- **char \\* yen64(int64_t value)**\n- **char \\* yuan64(int64_t value)**\n\n\n### float Wrapper functions\n\nExperimental - not tested\n\nAll assumes 2 decimals except bitcoin which has 6.\n\n- **char \\* bitcoinf(double value)**\n- **char \\* dollarf(double value)**\n- **char \\* eurof(double value)**\n- **char \\* poundf(double value)**\n- **char \\* roublesf(double value)**\n- **char \\* yenf(double value)**\n- **char \\* yuanf(double value)**\n\n\n## Operation\n\nSee examples.\n\n\n## Performance\n\nPerformance is hard to optimize. Most time is spend in splitting \nindividual digits (div / mod 10).\n\n\n## Future\n\n#### Must\n\n- update documentation.\n\n#### Should\n\n#### Could\n\n- More wrapper functions?\n- test double parameters.\n  - should decimals be a parameter too?\n- add BTC, USD, EUR, GBP, RUB, JPY, CNY, etc. (3+1 chars)\n- https://www.easymarkets.com/eu/learn-centre/discover-trading/currency-acronyms-and-abbreviations/\n\n#### Won't\n\n- currency conversion?\n  - intern all in ???\n\n\n## Support\n\nIf you appreciate my libraries, you can support the development and maintenance.\nImprove the quality of the libraries by providing issues and Pull Requests, or\ndonate through PayPal or GitHub sponsors.\n\nThank you,\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRobTillaart%2FCurrency","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRobTillaart%2FCurrency","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRobTillaart%2FCurrency/lists"}