Hacker News new | past | comments | ask | show | jobs | submit login

I too played it safe and avoided floating point operations in the loom.cc code:

https://loom.cc/?function=grid_tutorial&help=1

All asset quantities are signed 128 bit integers under the hood. However, when the wallet interface displays a quantity, it uses a scale factor to place the decimal point. An asset type denominated in a fiat currency like USD or EUR typically uses a scale of 2. An asset type denominated in a commodity currency like GAU (grams of gold) typically uses a scale of 7, allowing a number like 31.1034768, which is the precise number of grams in a troy ounce. If you want to see it in kilograms, you can use scale 10.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: