dinero.js icon indicating copy to clipboard operation
dinero.js copied to clipboard

Adding all Currencies to also have Currency<bigint>

Open reckter opened this issue 3 years ago • 7 comments

Adding an additional 168-bigint to the amendments folder. that contain all currencies in Currency<bigint> format. I am not sure wether this is the right place or even way of doing it, but as they are currently missing, I thought providing one proposal on how to solve this might be a good idea.

Let me know your thoughts on this, happy to move the folder / or do something completely different :)

reckter avatar Feb 08 '22 15:02 reckter

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/dinerojs/dinerojs/3HYVDrhLGRSPmYLT9TQLJ7HoFCV2
✅ Preview: https://dinerojs-git-fork-opencreek-currencies-bigint-dinerojs.vercel.app

vercel[bot] avatar Feb 08 '22 15:02 vercel[bot]

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 03e3b1f6a422950869f6a024d589b6fc896c7b27:

Sandbox Source
@dinero.js/example-cart-react Configuration
@dinero.js/example-cart-vue Configuration
dinerojs/dinero.js Configuration
@dinero.js/example-starter Configuration

codesandbox-ci[bot] avatar Feb 08 '22 15:02 codesandbox-ci[bot]

Yes, creating two packages in the same fashion as the calculators seems like the right way to go.

sarahdayan avatar Nov 04 '22 21:11 sarahdayan

I just created PR #665 it moves the currencies packages to currencies-number. If @sarahdayan thinks this is the way forward, @reckter could you modify this PR to create a new currencies-bigint package?

Also just a though, to avoid duplication, would making a script to generate the currency files be a better approach? All the data could be in a single json file.

johnhooks avatar Nov 06 '22 11:11 johnhooks

@johnhooks Totally agree that we should generate the currencies. The currency package could actually be repurposed into it, holding a single TypeScript or JSON file with the definitions. Users could reuse it to generate currency packages for custom amount data structure.

sarahdayan avatar Nov 06 '22 13:11 sarahdayan

@johnhooks Looking at #670, it should be fairly trivial with that to implement this PR, so will look into that after it has been merged. (Feel free to just go ahead yourself, If I take to long 😅 ). Thanks for picking this up again 🍺 !

reckter avatar Nov 09 '22 09:11 reckter

Sounds good!

johnhooks avatar Nov 09 '22 14:11 johnhooks