Changing thousand separator at run time? Localization?

TeeChart for ActiveX, COM and ASP
Post Reply
rajeev
Newbie
Newbie
Posts: 4
Joined: Fri Nov 15, 2002 12:00 am

Changing thousand separator at run time? Localization?

Post by rajeev » Sat Jul 21, 2007 3:03 pm

Hi
We are using TeeChart (v5) to draw chart and then send the images to web pages. We want to use user specific preferences for formatting to print the numbers (for example: US 123,456,789.0 while French
123 456 789,0
Ideally I would like to pass MS LCID and the number and just be done with it.
Or I'll be happy if I can specify the thousand separator to use for number format (for e.g. ###,##0.0 does the job for US, but the separator is always a ,

any ideas?

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Mon Jul 23, 2007 7:39 am

Hi rajeev,

You can take a look at your Windows Control Panel -> Regional and Language Options go to Customize and try modifying your decimal symbol and your digit grouping symbol.

If this doesn't solve your problem, let us know.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

rajeev
Newbie
Newbie
Posts: 4
Joined: Fri Nov 15, 2002 12:00 am

I want to programmatically set formatting ...

Post by rajeev » Wed Jul 25, 2007 11:28 am

Thanks for the suggestion, but I do not think I was clear enough.

Basically the situation is:
We are using Teechart behind the scenes to generate graphs and serve it over the web. Multiple users could be coming in with each of their preferences for formatting options - so based upon the option i want to change the thousand separator/decimal separator used by teechart for creating that particular graph. Effectively we will have two formatting: US style (123,456.78) or the French/Mainland European (123 456,78) - but do want to change between the two

Any suggestions?

thanks
rajeev

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri Jul 27, 2007 3:18 pm

Hi Rajeev,

In terms of displaying numbers in a TeeChart, what is actually displayed in will depend on the locale defined in the Windows Regional Options, more specifically in what is set in the Decimal Separator and Digit Grouping Symbol under "Numbers". For example, I run a US version of Windows System with the local set as "Spanish" (which uses the Number format used by Spanish and German) and when I run the following VB code:
Private Sub Form_Load()
With TChart1
.AddSeries scBar
.Axis.Bottom.Labels.Angle = 90
For i = 37000 To 37028
.Series(0).AddXY i, Rnd * 100, "", clTeeColor
Next i
End With
End Sub

The numbers on the bottom axis appear as "37.012", "37.014" etc. Opening "Regional Settings" and changing the locale in "General", the default locale in "Input Locales" and the locale in the toolbar to English (United Kingdom) and running the code above gives me "37,012", "37.014" etc.on the bottom axis without any need for further programming.

rajeev
Newbie
Newbie
Posts: 4
Joined: Fri Nov 15, 2002 12:00 am

Number formatting

Post by rajeev » Tue Aug 07, 2007 6:18 pm

So is there a way for me to change the Locale setting programmatically (we are using C++, so have access to Wn32 apis) before TeeChart starts drawing the graph? Here is what I want to do (in pseudo code)

function drawGraph(StylePrefEnum stylePref, int graphId) {
if (stylePref == EUROPEAN) {
do something
}
else {
do somthing
}

..
data = getDataForGraph(graphId)
..
cleanUpCurrentTeeChartObject()
..
createSeriesAndAddPoints(data)
teechart.redraw()
..
teechart.export() ...

}

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Aug 08, 2007 8:57 am

Hi rajeev,

I'm afraid this is not a TeeChart related question and we are not able to help you on this. However I'm sure you'll find lots of information on how to achieve what you request Googling a little bit.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Arieh
Newbie
Newbie
Posts: 28
Joined: Mon Feb 21, 2011 12:00 am

Re: Changing thousand separator at run time? Localization?

Post by Arieh » Fri Apr 15, 2011 8:53 am

Hi,
We are using Teechart2010. Does TeeChart2010 stick to the Regional Settings or is it now possible to change the decimal symbol programmatically?

thanks
Jürgen

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Changing thousand separator at run time? Localization?

Post by Yeray » Fri Apr 15, 2011 10:28 am

Hello Arieh,

Take a look at the following example:
http://www.teechart.net/support/viewtop ... 387#p36387
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply