type casting problem from string to float in java script

Hi All ,

Ima reading one float value from .txt file , after reading we want to convert that value from string to float ,

How can i do that ?

parseFloat(). Although you will get different results in different regions, i.e. “1.23” vs “1,23”. You can do “System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(“en-US”);” in an Awake function, which should make it always use the “1.23” format.

–Eric

@Eric: Thank you! This has been causing me some really strage problems, but forcing the locale settings this way fixes them. Great! :slight_smile: