orhtej2@eviltoast.org to Programmer Humor@programming.devEnglish · 2 months agoFloating point arithmeticseviltoast.orgimagemessage-square41fedilinkarrow-up1735arrow-down17
arrow-up1728arrow-down1imageFloating point arithmeticseviltoast.orgorhtej2@eviltoast.org to Programmer Humor@programming.devEnglish · 2 months agomessage-square41fedilink
minus-squareSmoothLiquidation@lemmy.worldlinkfedilinkEnglisharrow-up12·2 months agoAs other people mentioned, things like the decimal structure works well, but you can also just use an int to store how many pennies something costs and convert it to dollars for display.
As other people mentioned, things like the decimal structure works well, but you can also just use an int to store how many pennies something costs and convert it to dollars for display.