Reputation: 3360
I have this big number (a double
): 123456789012345.012345
That should be represented as: 123.456.789.012.345,01
using the pt-BR
format.
This is the format {0:###,###,###,###,##0.00}
that I'm using, yet this is the result:
As you can see, after 13 characters, the format starts to round the decimal places. How can we display correctly the number without rounding?
Upvotes: 0
Views: 65
Reputation: 51
decimal numb = 123456789012345.012345m;
string strNumb = string.Format(new CultureInfo("pt-BR"), "{0:###,###,###,###,##0.00}", numb);
string strNumb2 = string.Format(new CultureInfo("pt-BR"), "{0:###,###,###,###,##0.00}", 123456789012345.012345m);
You can use decimal instead of double.
Upvotes: 2