C# CultureInfo NumberFormat NumberDecimalSeparator Problem

Posted by Mahdi on Stack Overflow See other posts from Stack Overflow or by Mahdi
Published on 2011-01-14T15:43:57Z Indexed on 2011/01/14 16:53 UTC
Read the original article Hit count: 358

Filed under:
|
|

I want to change NumberDecimalSeparator of my application from "." to "/". it works when i show float numbers in my textbox. but integer types are not shown at all.

I modify thread's culture to get application-wide formatting. my code is like this:

CultureInfo ci = new CultureInfo("fa-IR", true);
ci.NumberFormat.DigitSubstitution = DigitShapes.NativeNational;
ci.NumberFormat.NumberDecimalSeparator = "/";
Thread.CurrentThread.CurrentCulture = ci;

result:

3.14 => "3/14" 100 => ""

Any help please ?

© Stack Overflow or respective owner

Related posts about c#

Related posts about cultureinfo