How to acces transform.rotation?

I have a problem. I try to acces Y rotation of a gameObject, but in debug I get different numbers than in inspector

I tried with localRotation and also with localEulerAngles. but Still I dont see the same numbers as in editor
I want to debug Y.rotation that is -87 but I can not get it as it is

Inspector shows Euler angles, the rotation of a transform is internally handled as Quaternions. You may want to google a little bit to understand the rough difference.

if insepctor shows Euler Angles Why cant I Debug them as in insector as Debug.Log(this.transform.eulerAngles) or
Debug.Log(this.transform.localeulerAngles)? The angles will appear but not as in inspector

transform.localEulerAngles does show the euler angle values that are in the inspector.

2864276--209726--Screen Shot 2016-11-25 at 7.10.02 PM.png

Note that there’s more than one correct way to convert quaternions into euler angles. If you click off an object and back on it, the rotation values may reset to “different” values that are actually still the same rotation. That’s why attempting to read a single axis from transform.eulerAngles isn’t recommended, since it’s not necessarily meaningful out of context with the other two axes.

–Eric