I am looking for a format to use with string.Format that would print the following
double d = 123456.123456D;
double d2 = 123456D;
like
123,456.123456
123,456
{0:N6} results in
123,456.123456
123,456.000000
{0:0.######} results in
123456.123456
123456
{0:#.0} results in
123,456
123,456
I cannot workout a format that will get me to what I need. Will I need to define my own format provider ?
You're close. Use this format:
{0:#,0.######}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.