Round function Perspective

Hello, in ignition I want to round a number until it is close to 0.8, that is, if I have the value of 2.7 it is rounded to 2 and if the value is 2.8 it is rounded to 3, is there an expression to achieve this?

I have used the floor function but it does not achieve what I describe.

Thanks in advanced.

See if this does what you want. I am sure there is probably another better way to do it.

if(round({value}%1,1) >= .8, {value}-{value}%1+1, {value}-{value}%1)

Edit: fixed the round down part.

1 Like

To slightly tweak this:

if(round({value}%1,1)<.8, floor({value}),ceil({value}))

or really even

if({value}%1<.8, floor({value}),ceil({value}))
1 Like



Thanks to everyone!

As usual, @PGriffith is the best golfer. :golfing_man:

1 Like