Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Microsoft .Net & .Net Compact Framework
 QCChart2D and QCChart2D CF (VB and C#)
 Decimal seperator - Change regional settings
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Tomaso

16 Posts

Posted - 15 Jan 2008 :  02:21:27  Show Profile  Reply with Quote
Can I force the NumericAxisLabels to use a particular decimal seperator?

My regional settings is "IT" but I would like use the point instead of a comma to separate the decimal.

Is that possible?

quinncurtis

1164 Posts

Posted - 15 Jan 2008 :  09:10:40  Show Profile  Reply with Quote
You can change the default decimal separator, set by the default CultureInfo settings of the computer, to anything else that you want, using code similar to below:

System.Globalization.CultureInfo cultureinfo = 
      new  System.Globalization.CultureInfo (System.Threading.Thread.CurrentThread.CurrentCulture.Name);
cultureinfo.NumberFormat.NumberDecimalSeparator = ".";
System.Threading.Thread.CurrentThread.CurrentCulture = cultureinfo;


Place this in the constructor of your main form so that it is called before any plotting routines.
There are many variants of this that you can use (just search on the web), but we had problems with ReadOnly access of the CurrentCultureInfo settings. The code we show above seems to work.
Go to Top of Page

Tomaso

16 Posts

Posted - 17 Jan 2008 :  03:42:18  Show Profile  Reply with Quote
Ok!
This is the final code that I used, and it works properly

Dim culture As New System.Globalization.CultureInfo("it-IT")
Dim numberFormat As New System.Globalization.NumberFormatInfo()
numberFormat.NumberDecimalSeparator = "."
culture.NumberFormat = numberFormat
System.Threading.Thread.CurrentThread.CurrentCulture = culture

Thanks
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07