- Home /
Format Money
Hey, does anyone have an idea how to format the GUIText.Text string of an amount of money, like ... 1000000€ to 1.000.000€ ?
Comment
Best Answer
Answer by Dave-Carlile · Oct 24, 2013 at 02:51 PM
You're interested in string.Format, or you can just pass the format string to `.ToString'...
http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx
e.g. :
float value = 1234.56f;
Debug.Log("Value = " + value.ToString("C"));
edit: Also, this should honor the user's current culture, so you should get the appropriate separator and currency symbol.
Your answer
Follow this Question
Related Questions
FormatException: Input string was not in the correct format 1 Answer
Litjson autoformat 1 Answer
Formatting Date and Time 3 Answers
Currency String Format 1 Answer
Seperate large numbers with comma 2 Answers