Skip to Content
author's profile photo Former Member
Former Member

How to use decimal/thousand separators depending on locale settings?


I have a problem with formatting number fields in Crystal Reports 2011. When I have a default formatting (System Default Number Format), everything is OK, i.e. I get the result 1.23 or 1,23 depending on the locale I run the report (decimal separator changes accordingly to locale settings). The problem occurs when I need to change for example number of decimals - then the decimal separator is "hardcoded" to , (coma) and doesn't change even when the locale settings change, so what I get is always 1,234 (and should be 1.234 for English for example).

Is there any way to change this behaviour ? One suggestion I found is to use formula to retrieve separators, like:

if contentlocale="en_US" then '.' else ','

but then I would have to use it for all number fields in my report.

Can I somehow set separators programatically when calling report from Java (same as setLocale method)? Or is there any "abbreviation" for separators like in Oracle Reports (D for decimal, G for grouping - they change accordingly to locale settings)

thanks for all answers



Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Jun 11, 2014 at 04:09 PM

    hi Maciej,

    if you want to do this in java please post your question to the forum here.

    in crystal probably the best way to do this is to first create a custom function that include a case statement, taking in the locale, and then an output to a totext() format.

    you could then quickly change the format of the number field by going to Format Field > Common tab and then Display String. the custom function would be called in this dialogue.

    after you format one number then use the Format Painter to format the other number fields that you want to change.


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.