mastodon.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
The original server operated by the Mastodon gGmbH non-profit

Administered by:

Server stats:

360K
active users

@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 .