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?
Changing thousand separator at run time? Localization?
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.
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,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
I want to programmatically set formatting ...
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
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
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.
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.
Pep Jorge
http://support.steema.com
http://support.steema.com
Number formatting
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() ...
}
function drawGraph(StylePrefEnum stylePref, int graphId) {
if (stylePref == EUROPEAN) {
do something
}
else {
do somthing
}
..
data = getDataForGraph(graphId)
..
cleanUpCurrentTeeChartObject()
..
createSeriesAndAddPoints(data)
teechart.redraw()
..
teechart.export() ...
}
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
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 |
Instructions - How to post in this forum |
Re: Changing thousand separator at run time? Localization?
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
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
Re: Changing thousand separator at run time? Localization?
Hello Arieh,
Take a look at the following example:
http://www.teechart.net/support/viewtop ... 387#p36387
Take a look at the following example:
http://www.teechart.net/support/viewtop ... 387#p36387
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |