Round number

Hi guys, something very simple but I can’t find the way.
in this code i want to round the result to an integer
(j1.home_od < 2)?(-100 / (j1.home_od - 1)):((j1.home_od - 1) * 100)
j1.home_od = 2.255

get as result 125.4999999
I have already tried .round() but it gives me an error
Note: 0 skill code


Hi, did u try with .round(0) ?. You can also try with the formatter “# Format number” and put the decimals at 0.

maybe I am missing something, as I said before, I have no skill with code
I tried to do something simpler, round a simple number, use “round” and it didn’t work for me and “format number” didn’t work either

(23.4332).formatNumber(2, '.', ',')
this is the correct code?

We encountered this error sometime ago. Its a Javascript problem. The way JS works with numbers, and floating values specifically.
The workaround we implemented was to simply do a round(2) since we needed 2 decimal places.

In your case it would look something like:
((j1.home_od < 2)?(-100 / (j1.home_od - 1)):((j1.home_od - 1) * 100)).round(2)

hey guys, it has become impossible for me to round the numbers that are variable values, even very simple numbers

When I run it, it doesn’t show me anything.


What does it show without the rounding function?