Rounding dilemma

Do you know if there is a case/issue for this?

No. I discussed that issue with Joe eons ago.

Edit: Hey, I’ve found one, just for the literal cases:

You’re overstating the case here. The inaccurate representation of floating point numbers in computers was a design decision many, many years ago due to memory constraints. There is no reason any computer could not be designed with a 100% accurate, arbitrary precision system instead.

First of all, it must be clear that floating point is NOT the same as a DOUBLE.

Xojo uses the IEEE 754 standard, this data type is NOT meant for currency or any other calculations that need Precision. There are hacks, trics etc that can reduce the problems but you are going to have Precision problems.

To work with exact values, Xojo ONLY offers the Currency DataType…

No, you are not wrong, this is a SERIOUS LIMITATION IN XOJO. They decided to have only 4 digits of precision even when in most of the WORLD, the standard for currency values is to use 6…

Well, it sucks but there is NOT a built in solution in xojo to work with more than 4 digits of precision.

You have only 2 options:

  1. Use only integer variables and adjust the decimal point every time you do math (yes, you have a “modern” tool where you have to “carry the 0” manually) I ended doing this for some currency math in an app.

  2. Use a plugin ( Delaney or MBS ), in this way, you will have an extra DataType available in xojo that can store exact values.

Maybe MBS can implement Dec64 in Xojo (there is a C library as I remember).