i defined a variable type of double and debug it,like this:
double a = 12.1234d;
Debug.Log("a: " + a);
the unity console is:
[33957-qq截图20141020112050.png|33957]
why not is 12.1234?
i defined a variable type of double and debug it,like this:
double a = 12.1234d;
Debug.Log("a: " + a);
the unity console is:
[33957-qq截图20141020112050.png|33957]
why not is 12.1234?
Unity uses floats instead of doubles. They pretty much do the same thing. Just change the code to this and it will work perfectly:
float a = 12.1234f;
Debug.Log("a: " + a);
Windows might have this as a setting in “Region and Language” options, see http://hotware.files.wordpress.com/2009/12/regional.png
i have been doing as you said, the debug also is 12,1234. it seem only happen on windows, why
– 123inchNot sure why that is exactly but if you stick with floats it should always work correctly!
– TurkeybagStill thank you
– 123inch