Hacker News new | ask | show | jobs
by nijave 788 days ago
Yeah, this seems like a common pattern. Not sure about currency with arbitrary place values though (like Bitcoin)
1 comments

I'm not sure what you mean by "arbitrary place values" with Bitcoin; if you are implying it's infinitely divisible, it isn't. You'd do the same trick with Bitcoin: represent it as an integer¹. The value 1 is 1 sat, or 0.00000001 BTC.

¹(where you need to; otherwise, I'd use some fixed point type if my language supports it)