Stange rounding of numbers in Confirmation

I would like to add a clarification: decimals are not fixed floats.

The original question asks about showing a number in the UI. The problem here is not how the number is stored or its precision. The problem is how it appears in the UI, and the solution is what I said in my first answer: format the number into a string.

Perhaps @KR1 has good reasons to use floats, and shouldn’t switch to decimals (even if they existed in Skulpt) just because they don’t look pretty in the UI.

Decimals have some limitations, different from the limitations of the floats. You are not solving the problem, you are trading some limitations for other limitations.

The real solution is to know what’s going on, and to do the right thing to deal with it.

Decimals are typically used in financial applications, where high precision means something different from other applications that typically use floats.

1 Like