Rounding Numbers in Max

jack_shephard's icon

Hi there, is it possible to round a decimal number to the nearest whole number.

So if i inputted 60.9 and 70.2, it would always output 70.

Thanks.

kjg's icon

[+ 0.5] >> [int]

Gregory Taylor's icon

Sure - slap an integer number box on the float output, which truncates. If that doesn't float your boat and you want to round "like humans do," then add. .5 and then slap an integer number box on the float output.

ch's icon

or just use [round]

Tim Lloyd's icon

The [round ] object is more convenient.

jack_shephard's icon

Thanks everyone, feel a bit silly now :P

Roman Thilenius's icon

[expr (int($f1-0.5))*($f1=0)]

Emmanuel Jourdan's icon

a more concise one int($f1 + ($f1 > 0) - 0.5).

Roman Thilenius's icon

nice one, danke ej