Problem with round

The formula round( numer,1 ) often doesn’t work. I have a formula and some days it still display many many numbers after the coma. Example today 13 February I get the screenshot attached

I tried other numbers of rounding like 2 and 3 but it’s the same just bugs on different days

Here is the entire formula

$-mu( round,tf(2024y06M19d,D)/7/4.345,1)$M/1.$-mu( round,tf(2024y06M19d,D)/7/4.345,0)-12$A👶

Please help thanks

The 9.89999… issue happens because of float precision errors when you stack multiple divisions inside the formula. To fix this and ensure it always rounds correctly, try wrapping the entire calculation inside the mu(round) function like this:

$mu(round, mu(abs, tf(2024y06M19d, D)) / 30.415, 1)$

(using 30.415 as an average month instead of 7 / 4.345).

1 Like

Merci beaucoup ! Ça a marché !:heart_eyes:

I’ve noticed Kustom can be a bit finicky with nested formulas. If you’re still getting a long decimal, sometimes wrapping the whole thing in another $mu(round, 2)$ at the very end helps force it to behave.