rounding the rotation angle of an object

i tried using

selection.rotation.eulerangles.set(mathf.roundtoint(selection.rotation.eulerangles.x) , …same for y, …same for z);

yet after i rotate an object it appears the object (in editor)
still doesn’t appear to be rounded.

should this work?

Given that the internal rotation of a transform is held as a Quaternion rather than a set of Euler angles I’d guess that the conversion process from Quaternion to angles is floating point and that floating point inaccuracies creep in an make the final rotation not exactly the same.