Comment

Comment by tiedieconderoga

It would be neat to have a fundamental "money" primitive alongside int, float, string, etc.

It might not be simple to implement, though. Off the top of my head,

* Can you confidently say that $100>¥10 in an offline environment?

* You'd need to support different bases for splitting units to deal with eldritch values such as farthings.

* Where is the line drawn? Is a Bitcoin a valid currency? A gold Krugerrand? A bundle of stock shares? A bushel of apples?

All of that said, I would love to see a world where I could write code like:

    money balance = money.lumber.grade.kilograms(8);

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton