How to add more commands in the ToString();

I want to have a large number with no decimals and commas.
i know i can do ToString(“n2”); for commas and ToString(“0f”); for no demials. how do i put both in?

Example ToString(“n2”,0f"); (doesnt work)

Those aren’t “commands” but format descriptors. You probably just want to use “D”. However “D” only works with integral types (byte, short, int, …) but not with floating point numbers (float, double, …). However if you have a floating point number you can cast it to “int” or “long” before you call ToString.

Though the format “F0” should work as well. F0 has no 1000th-commas and no decimal digits.

You could try using the string.Format function

float variable1 = 13f;
int variable2 = 14;
bool variable3 = false;

string formattedStr = string.Format("My float = {0}, my int = {1}, my bool = {2}", variable1, variable2, variable3);

For information about formatting floats etc. with specified decimal digits, look here:

for example string.Format("{0:F0}", myFloatVariable); should do the trick for floats without decimal digits. I haven’t testet it though.