Learning #rust and trying out https://github.com/Aloxaf/silicon
all I can say is wow!
@sgtnasty Apart the fact I despise code in images, the example code is very wrong.
You **NEVER** use floating point types for any accounting related computations. It's plain WRONG!
@michalfita so use i32 and multiply by 100? Im no accountant.
@sgtnasty And definitely not software engineer by education - people who did floating point classes at uni would know.
You'll find you divide by 100 error prone and problematic to maintain and apply rounding properly. Accounting rounding differs from standard maths rounding.
Use dedicated library for fixed point money types that are battle tested. Or write code in #Cobol.