heiglandreas,
@heiglandreas@phpc.social avatar

I am continuouslyreading that the best way to represent Money would be to use the smallest denominator of a currency. Like use cents for Euros.

Is it just me that feels like its oversimplifying things? That that is like "use UTC-timestamps for datetimes"?

https://gist.github.com/rgs/6509585 is for sure a good read.

To me any system that isn't capable to handle the british pre-1970s currency is not up to the job. Not because we should go back there, but because it is based on too many implicit assumptions

ocramius,
@ocramius@mastodon.social avatar

@heiglandreas using fractional numbers works, but you still need to reach a full number when you have to communicate to a customer or external system, so you need some bookkeeping for remainders

heiglandreas,
@heiglandreas@phpc.social avatar

@ocramius Fractional numbers work. As long as we pass the base as well. As it might not be 100.

ocramius,
@ocramius@mastodon.social avatar

@heiglandreas yes, but in internal systems, they can flow as fractional.

At the edges of the system, difficult decisions (where accounting domain experience is needed) are to be taken

heiglandreas,
@heiglandreas@phpc.social avatar

@ocramius At the moment I'd argue the fractional approach. But OTOH it's not a hill I'd want to die upon and if someone wants to shoot their feet, 🤷

ocramius,
@ocramius@mastodon.social avatar

@heiglandreas FWIW, most accountants (also in Germany) were really clear that "nobody gives a damn".

The general direction proposed by multiple accountants I talked to (as part of my consultancy work in Germany) was "round it, and if the rounding errors become too big, we discuss remediation with the Finanzamt", and "if there is a problem, there's a ~3y timeline to resolution, plus a fine"

ocramius,
@ocramius@mastodon.social avatar

@heiglandreas like... that was multiple accountants and attorneys that I talked to, and that literally told us to YOLO with float, heh.

Solving the problem at its core was more expensive than paying up for rounding errors to the tax system, and adjusting if fined.

I'm not saying this is right, and it will also not work for micro-trading, but for generic ECommerce it's fine(d), and that's it.

beausimensen,
@beausimensen@phpc.social avatar

@ocramius @heiglandreas I still haven’t wrapped my head around dealing with such small fractional numbers you get in cryptocurrency. Seems… fun.

https://stackoverflow.com/a/48555882

ocramius,
@ocramius@mastodon.social avatar

@beausimensen @heiglandreas cryptocurrencies are irrelevant anyway: nobody in the real world cares.

beausimensen,
@beausimensen@phpc.social avatar

@ocramius @heiglandreas No, but for the sake of modeling currencies, I figure they can be interesting reference points for taking factional currencies to the extreme.

tappenden,

@beausimensen @ocramius @heiglandreas Agree with Marco and can extend this to the UK, US and Australia. Absolutely nobody cares. Like, at all. Don't invent problems.

And, yeah, cryptocurrencies != money.

heiglandreas,
@heiglandreas@phpc.social avatar

@tappenden @beausimensen @ocramius Yeah. In that regard it's like datetime. 🙈

beausimensen,
@beausimensen@phpc.social avatar

@tappenden @ocramius @heiglandreas The thread started w/ discussion around "1/100 is enough" being a bad assumption. I was playing off the idea that you can't simply say "we will just use 1/1000; it will work for everything!" Somewhere out there will be an edge case where 1/1000 won't be enough.

Whether anyone thinks it's real or not, a non-trivial amount of code works w/ cryptocurrencies along side traditional currencies where 1/1000 is already not enough.

beausimensen,
@beausimensen@phpc.social avatar

@tappenden @ocramius @heiglandreas I'm not a huge proponent of cryptocurrencies by any means. I'm not sure why I'm getting this reaction. Maybe I'm reading to much into it.

I think fractional currencies to the level cryptocurrencies go is ridiculous. I also appreciate the viewpoint that rounding errors maybe don't even matter in the "real world" (YOLO).

kboyd,
@kboyd@phpc.social avatar

@beausimensen @tappenden @ocramius @heiglandreas a non-cryptocurrency equivalent issue is hyperinflation adjustments. Sudden decimal place movements for an entire currency (I think Venezuela did this about a decade ago?)

ramsey,
@ramsey@phpc.social avatar

@beausimensen @tappenden @ocramius @heiglandreas They made a movie based on this: Office Space.

beausimensen,
@beausimensen@phpc.social avatar
ihabunek,
@ihabunek@mastodon.social avatar

@heiglandreas What's your solution? Implementing a system which can handle all possible ways of denoting currencies seems like overkill. Yagni and all that. I usually just end up with decimal in the db and do the rounding logic in code.

heiglandreas,
@heiglandreas@phpc.social avatar

@ihabunek I don't have a perfect solution. But if I'd have to transmit or store currency, then I'd transmit or store it the way people handle it. As 10 Euros 45 cents. Or - for the sake of it - 1 pound, 3 shilling, 6 pence.

How to handle the odd gas-prices? Well, those are decimals (like, mathematical), so why not store them as decimals.

And yes! That means one system for currencies like Euro or dollar, one foe dinar and one for Pound pre 1970. And perhaps others.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • mdbf
  • ethstaker
  • magazineikmin
  • GTA5RPClips
  • rosin
  • thenastyranch
  • Youngstown
  • InstantRegret
  • slotface
  • osvaldo12
  • kavyap
  • khanakhh
  • Durango
  • megavids
  • everett
  • cisconetworking
  • normalnudes
  • tester
  • ngwrru68w68
  • cubers
  • modclub
  • tacticalgear
  • provamag3
  • Leos
  • anitta
  • JUstTest
  • lostlight
  • All magazines