This code is from Charles Pettzold's "Programming Windows Sixth Edition" book:
public object Convert(object value, Type targetType, object parameter, string language)
{
return ((double)value).ToString("N0");
}
ToString("N0")
is supposed to print the value with comma separators and no decimal points. I cannot find the reference to appropriate ToString
overload and "N0"
format in the documentation. Please point me to the right place in .NET documentation.
You can find the list of formats here (in the Double.ToString()-MSDN-Article) as comments in the example section.
Here is a good start maybe
Double.ToString()
Have a look in the examples for a number of different formating options Double.ToString(string)
This is where the documentation is:
http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx
And this is where they talk about the default (2):
http://msdn.microsoft.com/en-us/library/system.globalization.numberformatinfo.numberdecimaldigits.aspx
Checkout the
following article
on MSDN about examples of theN
format. This is also covered in theStandard Numeric Format Strings
article.Relevant excerpt: