How to make 1e+07 appear as 10000000

I’m making a clicker game and the cost of one of the items is 10000000, but unity automatically converts that to 1e+07. Is there any way i can make it only show whole whole numbers?

You can use a standard numberic format string or even a custom numeric format string. You probably want to use the standard format “D”.

string s = val.ToString("D");

Keep in mind that floating point numbers loose precision the higher the values get. 10 million is already a quite large value. If you only work with integer values you may want to use an “int” or “long” value depending on your required range.

If you use floating point values, have a look at this table to better understand how the precision changes with higher values.

Search for “C# float to string without scientific notation”: http://davecallan.com/converting-numbers-strings-without-scientific-notation-c/