Seperate large numbers with comma

How do I format a number such that it has a comma in every thousand position (both integers and floating values?)

For example 1000000.35 will be 1000,000.35?

You can use the `ToString()` function of the variable like this:

var num : float = 1000000.35;

Where `n` is for `number` and 2 is the number of decimal places you want to display. If you don't want to use the comma use `f` (`float`) instead.

To complement Lipis' answer:

The version of Mono (which is a version of .net) in Unity comes with a wealth of built-in formatting options, so you can use the MSDN reference to look this sort of thing up:

For more information see the MSDN documentation on "N" formatting:

And on standard number formatting in general:

And on applying custom formats to your number strings: