Truncate the fractional part and preserve the decimal point.

tildamin's icon

I'd like to truncate the the factional part of a floating point number but preserve the decimal point in the output. I won't know the number in advance.

For example [4.25] -> [0.25]

Any help would be greatly appreciated.

LSka's icon

two ways: the first using the [round] object and the second using the [trunc] operator in gen

Max Patch
Copy patch and select New From Clipboard in Max.

George Luther's icon
truncate.maxpat
Max Patch

tildamin's icon

Thank you so much!! That did it!

Roman Thilenius's icon


expr $f1 - int($f1)