Lurker News
Manipulating monetary amounts is a common computing chore. However, no mainstream language has a first-class data type for representing money, it’s up to programmers to code abstractions for it. This isn’t an issue per se until dealing with rounding issues from operations like installment payments (e.g., buy now, pay later), foreign exchange, or even simple things like fee processing and tax collection.

Inspired by my days at N26 Brasil dealing with these challenges, I introduce Money: a Kotlin library that makes monetary calculations and allocations easy.

Comments (228) 50 threads

Show all comments

Showing thread 46 of 50

boronine1 reply#
I think most of this is covered by a good Decimal API, currency stuff probably shouldn't be embedded into a language because it changes: currencies come and go, get redenominated etc. Although one simple thing that would be useful is keeping track of abstract units, e.g. throwing an error when attempting to do 10 USD + 10 EUR.
oblio1 reply#
Don't we embed timezones, though?
explorigin1 reply#
Timezone conversions don't change by the minute. Currency conversions do.
oblio#
Do most applications use the minute-to-minute conversions or some daily rate?

I'm fairly sure that for example for RON, the Romanian Central Bank only publishes daily rates, for example.