We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

setting NumberFormat in different locales

Thread ID:

Created:

Updated:

Platform:

Replies:

54015 Dec 27,2006 01:35 PM UTC May 29,2007 06:07 PM UTC WinForms 6
loading
Tags: XlsIO
Stefano Martinz
Asked On December 27, 2006 01:35 PM UTC

Hi there,
Is there any way of setting a NumberFormat, using the format strings supported by different locales?

For example, the decimal separator is '.' for US locales, whereas it is ',' for Italian ones. So, the italian format "0,00" is equivalent to "0.00" for US.

Does XlsIO support only US formats? Or is there a way to set the culture?

thanks,
Stefano

Melba Winshia [Syncfusion]
Replied On January 2, 2007 01:37 PM UTC

Hi Stefano,

Please accept my apologies for the delay in getting back to you. Essential XlsIO support only US formats. But it will preserve all the culture settings. Please let me know if you have any other questions.

Thanks,
Melba

Keyur Patel
Replied On May 25, 2007 05:38 PM UTC

I am having this same problem. Are you going to add a feature that allows non-US formats?

I try to set the NumberFormat to this: "#.##0,00",
and XlsIO automatically changes this in the Excel file to: "#,##000"

How do I get the proper number group (i.e. thousand) separator into the number format?

>Hi Stefano,

Please accept my apologies for the delay in getting back to you. Essential XlsIO support only US formats. But it will preserve all the culture settings. Please let me know if you have any other questions.

Thanks,
Melba

Ajish [Syncfusion]
Replied On May 26, 2007 12:54 AM UTC

Hi Keyur,

I am not sure if I understand your requirements correctly but here is a sample based on my understanding

http://www.syncfusion.com/Support/user/uploads/Globalization_8ff94d88.zip

In this sample the currency symbol is extracted from the culture info object and then used to construct the NumberFormat string. Please let me know if you have any questions.

Regards,
Ajish.

Keyur Patel
Replied On May 29, 2007 04:12 PM UTC

I looked at your sample, and tried exactly what you said. I set the number format like you indicated:
sheet.Range["A1"].NumberFormat = "[$" + currencySymbol + "-411]#.##0,00";

However, when I open the Excel file, the number format has changed to:
"[$€-411]#.##0,00000"

And, the number is not formatted with the "." number group separator. The number in Excel appears like this:
€1396407,75652

I am running Syncfusion version 4.2.0.37
My regional settings in Windows has been set to German (Germany).



Keyur Patel
Replied On May 29, 2007 04:17 PM UTC

Also, I noticed that if I just set the number format using USA standards, then the Excel file is formatted properly when I open it in another locale (e.g. Germany).

I only did this:
sheet.Range["A1"].NumberFormat = "#,##0.00 [$€-407]";

This seems to work.

Ajish [Syncfusion]
Replied On May 29, 2007 06:07 PM UTC


Hi Keyur,

Thank you for the update. Glad to hear that the problem has been resolved.

Regards,
Ajish.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;