I have a field that contains an integer, but I need it to always be an even number, and rounded down if necessary.

So 19 would become 18 for example

37 would become 36, etc.

Any ideas would be much appreciated.

I have a field that contains an integer, but I need it to always be an even number, and rounded down if necessary.

So 19 would become 18 for example

37 would become 36, etc.

Any ideas would be much appreciated.

Just wondering why rounding down is necessary?

It is relating to investments, and so the resulting number (which is to do with shares) needs to be below, otherwise they’d max out on the amount of shares bought.

Hi there, @Siddhartha… I believe you could use the <-modulo-> function to accomplish this task. If you do `integer<-modulo->2`

, you will get a result of 0 or 1, and then you can subtract that number from the initial integer.

Hope this helps.

Best…

Mike

2 Likes

`number/2:floor *2`

3 Likes

Thanks Mike. Much appreciated.

Thanks Adam. Much appreciated. I now have two solutions. You guys are the best.

This topic was automatically closed after 70 days. New replies are no longer allowed.