As per the documentation for Convert.ToString(double, IFormatProvider)
:
This implementation is identical to Double.ToString(IFormatProvider)
... which is then documented as:
The ToString(IFormatProvider) method formats a Double value in the default ("G", or general) format of a specified culture.
When you call ToString
, you're passing in N
- if you pass in G
instead, you'll get the same results as Convert.ToString
.
The G
format specifier documentation states:
The result string is affected by the formatting information of the current NumberFormatInfo object. The following table lists the NumberFormatInfo properties that control the formatting of the result string.
... and lists NegativeSign
, NumberDecimalSeparator
, PositiveSign
. Your code doesn't set any of those properties, which is why it's not making a difference. If you write:
culture.NumberFormat.NumberDecimalSeparator = "#"
for example, then that will affect the output of Convert.ToString
.