I need to apply the format to the number of type decimal
. Say a number 12345
must be shown in the format ## ##0,0
. Then, the required output is 12 345,0
.But somehow it does not apply correctly and I get the result as 1 2,345
.
Below is the code that does the formatting work. Also check this fiddle where my issue is reproduced.
UPDATED
CultureInfo ci = new CultureInfo("fr-FR");
decimal integral = Convert.ToDecimal("12345");
Console.WriteLine(integral.ToString("## ##0,0"));
I know there are many format relevant solutions already available but unable to get what's wrong with this way.