cancel
Showing results for 
Search instead for 
Did you mean: 

How do I create culturally sensitive number fields

Former Member
0 Kudos

If my data is (en-US format):

1.1

2000

123.15

...

I want to see the following if I've set my regional settings to en-US:

1.1

2,000

123.15

...

And I want to see the following if I've set my regional settings to fr-FR:

1,1

2.000

123,15

...

I'm not nearly as concerned about the thousands separator as I am about the decimal separator.

How do I accomplish this?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

What is the version of Crystal that you are using?

You can get the desired format by right clicking on the object and selecting the format field and select desired format or use customize button to customize the format.

If you want to change the format only by changing the regional settings then go to control pannel and select the regional settings and you can customize the formats for each data type using customize button.

This works fine if you are using Crystal XI or XI R2 but in Crystal 2008 I think you need to use menu option view>preferred viewing locale>select en-US or FR

Regards,

Raghavendra

Former Member
0 Kudos

Oh wait, I just re-read the 1st reply and maybe it will help. Are you saying that I can modify the number format while running in en-US, save the report, then change the regional settings to fr-FR, modify the number format again, save the file, deploy it and it will work as I want it to on the client machines?

I'll give this a try now.

Former Member
0 Kudos

Ok, so I tried changing my regional settings and changing the format, and that did not seem to work. Since I'm doing this in Visual Studio 2008, I don't have "menu option view-->preferred viewing locale".

Any other thoughts?

Former Member
0 Kudos

First of all, my apologies. This feature works, as expected, out of the box. I had taken an additional step which essentially stopped the runtime formatting of numbers.

So now there's a narrower "box" around the issue I'm having. I want to show data such as, 1.4, 1.6, 1.7, etc.

- By default, the number formatting does not display decimal places

- Changing this value in the format options for the field causes the runtime recognition of culture to stop functioning

So my real issue is that last part:

How do I change the decimal places shown without breaking runtime formatting of numbers based on culture?

Former Member
0 Kudos

Any thoughts? I don't want to clutter the forum and start a new thread, but I need to resolve this issue.

Answers (3)

Answers (3)

Former Member
0 Kudos

I sort of answered my own question and then raised another issue. I've opened a post about the second issue.

Former Member
0 Kudos

Thanks for the replies. To clarify: I am using the version of Crystal Reports which comes with Visual Studio 2008 and I am primarily concerned with the report when it is in the report viewer/finished application. How it looks in the editor is not important to me.

1st reply: Simply changing the format will not suffice. I need it to detect the client's regional settings and change them at runtime.

2nd reply: This is a client app so I don't believe we're using the technologies you mentioned; no servers are involved.

Former Member
0 Kudos

If you're using Enterprise/Infoview and want the report to adjust to whichever locale the server is in you can use "System Default Format" for your number format setting then it will adjust to the server's locale.