Limit visible value for the rotation angle

Hello,
how can I limit Y angle value for the empty object?
I need it to be from -90 to 90 degree.
If I use constraint, I can limit angle, but the typed (visible) value can be bigger than 90.

On the constraint, there’s a checkbox for “affect transform.” Click that checkbox.

This is the first thing I tried

You have the constraint set to world space. The numbers it’s showing you are local space numbers. These numbers will be limited by “affect transform”, but not to the same values, because world space and local space are different spaces.

Edit: except, that’s odd, the empty’s world space should be its local space, because it’s unparented. Do you have a file? (Maybe it has an inverse that didn’t get deleted?)

Edit2: How are you rotating the object? Are you doing rotation operations in the 3D viewport? Or are you just entering numbers in the transform field, or click-dragging the transform field? If the latter, the solution is, don’t enter numbers you don’t want to see. (There are weird things that you could do with custom properties and drivers to fix that, I guess, but that would be a waste of effort and CPU.)

This method.
I think this is what I need, but cant figure it out how to set it up properly

Yes, that’s probably the weird thing you could with custom properties and drivers-- but again, why make work for yourself? If you don’t want the number to go above 90, then don’t move it above 90. (And again, what the number says means absolutely nothing anyways-- even if you were driving from it, you could set your driver to be max(min(var, ceiling), floor).)

Thanks for helping.
Your second answer might be a solution for me if not click-dragging values.