String.Format with NumberGroupSeparator outputting 0xa0 not comma

Posted by andrevdm on Stack Overflow See other posts from Stack Overflow or by andrevdm
Published on 2010-06-01T19:21:45Z Indexed on 2010/06/01 19:43 UTC
Read the original article Hit count: 147

Filed under:

I'm seeing strange results when doing a string.Format( "C" );

E.g.

    double val = 123456.78;
    Console.WriteLine( val.ToString( "C" ) );

This prints the thousand separator as 0xa0 rather than a comma (0x2c).

I get the same result if I use string.Format( "{0:0,0.00}", 1234567.12D );

Here is the full output

R 123ÿ456,78
52333A333233
201230456C78

My regional settings are English (South African) and I'm getting the same result on multiple machines.

Any ideas?

Thanks.

© Stack Overflow or respective owner

Related posts about c#