- Home /
Question by
Noob_Vulcan · Dec 28, 2014 at 02:46 PM ·
c#parsing
String Parse
Hello ,
I want to print my number 10000000 like 10,000,000
any number should parse like that when i display using Label.(Normal currency )
How can i achieve this using the most efficient way ?
Comment
Best Answer
Answer by MartinCA · Dec 28, 2014 at 03:32 PM
Check out this article (assuming you're using c#)
http://msdn.microsoft.com/en-us/library/dwhawy9k(v=vs.110).aspx
In short, you can try using this example:
double dblValue = -12445.6789;
Console.WriteLine(dblValue.ToString("N", CultureInfo.InvariantCulture));
// Displays -12,445.68
Also, I would highly recommend specifying the locale or using invariant culture, otherwise you'll get random results based on the locale.
Your answer
![](https://koobas.hobune.stream/wayback/20220613175041im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Parsing an XML file periodically 2 Answers