C# formatting number

Viewed 162

I need one C# formatting string that will handle those cases:

For input of 1234.561 should produce: 1,234.56

For input of 1234 should produce: 1,234

I tried {0:N0}, {0:N2} and {0:#.##}. Doesn't work.

3 Answers
Related