Replies: 2 comments 1 reply
-
Hey @jvliwanag, I'm not sure I understand what you have in mind. Could you maybe share some code examples of what you'd envision? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Sure, so -- const fiveUSD: Dinero<USD> = dinero({ currency: USD, amount: 5_00 });
const tenUSD: Dinero<USD> = dinero({ currency: USD, amount: 10_00 });
const eightEUR: Dinero<EUR> = dinero({ currency: EUR, amount: 8_00 });
add(fiveUSD, tenUSD); // passes type check
add(fiveUSD, eightEUR); // should not type check |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Since 2.0 is being done on typescript, wondering if it would be good to place the currency directly on the typelevel.
Currently, there's TAmount which is sort of related. But except for doing exchange rates, you'd want to be doing the currency operations (add, subtract etc) on same currencies anyway.
Beta Was this translation helpful? Give feedback.
All reactions