You can simply call ToString with the selected format string.
For example, in your case:
int value = 21232221; string result = value.ToString("N");
As a result, the value 21,232,221 will be displayed as a result. For formatting, use "C" as the currency (although this will add the specified currency, that is: $). There are many options for format strings — see here for details.
source share