   Formatting Integer displaying to show commas?
  In xna are there any built in classes/methods to format an integer for text display so that lets say if im tracking the players game score, once it goes over 999 and hits 1,000, it will automatically display the , in the 1,000? :) If not, what would be a good way to go about creating that functionality.   
int score = 1234;string s = score.ToString("#,##0");That should do the trick. I'm not sure if there's a more internationally-friendly way to do it (I'm pretty sure it'll at least replace the comma with a period in locales that expect that, but I'm not sure how that it handle non-thousand separators)   ;Quote:Original post by MasterDarioIn xna are there any built in classes/methods to format an integer for text display so that lets say if im tracking the players game score, once it goes over 999 and hits 1,000, it will automatically display the , in the 1,000? :) If not, what would be a good way to go about creating that functionality.string myIntString = x.ToString();for (int i = myIntString.Length - 3; i > 0; i -= 3)  myInstString = myIntString.Insert(i, ",");;  ###,###,##0 did the trick. Thx a lot guys.   ;Quote:Original post by MasterDario###,###,##0 did the trick. Thx a lot guys.You actually only need the "#,##0" bit, it figures out the rest for you. But it probably doesn't hurt to add more either :-)   ;  Do note that it is best to use the culture-specific conversions in cases like this, if possible (I don't remember whether .net on XBOX360 has cultures fully implemented). That way, you get correct results even when you have to convert the string back to the original value. For display only, your current approach will work but even then it would be nice to show the values as the user wants.It is not very easy to parse the original values from strings, if your code must run internationally. Number and date formats vary wildly across the world and if you're not consistent with the conversions, you will run into trouble with "mysterious" bugs caused by this.   ;  Moving to General Programming.   