Hi Dirk,
I have already written a normalization function and integrated it into the Calculate Formula card:
I will now go through the other cards one by one and apply the same normalization where it makes sense.
Technical note: I now normalize JavaScript numeric results to 12 significant digits. JavaScript floating-point numbers are known to produce small precision artifacts in some decimal calculations, and this approach removes those artifacts without adding a heavy dependency.
The downside is that very large numbers, for example numbers with 10 integer digits, will only keep 2 decimal digits. However, I do not really see this as a problem in a smart home context. The alternative would be to include a larger arbitrary-precision math library, which would make the app bigger and more processor-intensive.
Best regards,
Pascal
