Decimal point formating

  • Hello!

    I'm trying to build a report with SSRS. And everythin was going well until I wanted to format the number in one of the columns. I live in Croatia and I want my nuber format to be 1.234,56 and I changed the number format in the field properties and the Languge to Croatian. There was no problem. But, I also need, depending on a certain field that the nuber format changes to 1.234,567 i.e. from two decimals to three and vice versa. I used the expression:

    =Iif(Fields!Data1.Value="String1",Format(Fields!Data2.Value,"N3"),Format(Fields!Data2.Value,"N2"))

    Problem is that the output was:

    String1 1,234.00

    String2 1,234.000

    The nuber format has switched places between ',' and '.'

    How do I overcome this problem?

    Thanks for your help,

    Marina

  • Because you are using the Format function you need to specify a user-defined format. Try checking out this article.

    I think you want something like this:

    =Iif(Fields!Data1.Value="String1",Format(Fields!Data2.Value,"#.###,###"),Format(Fields!Data2.Value,"#.###,##"))

  • Hi, thanks for your reply.

    But, unfortunately, that doesn't work. If I use the expression you suggested, the number format output is 1234.56 instead of 1.234,56 which were the original field settings.

    I read the article, and I think that when I use ',' and '.' in the expressions '.' always means the decimal separator, and ',' always means the thousand separator. The use of the Format function overrides the properties of the field and the number format.

    Do you have any other suggestions?

    Thanks very much,

    Marina

  • I found it!

    It required some digging in the XML code. It was the last Language tab. In the tags was written eng-US. I changed it to hr-HR and the retched thing worked. Still, I didn't find a way to change the language of the report in any other settings or options. I even tried in the Tools,Options,International settings. It only offered me English and the language like Windows. Is there any other way? I would like to find a way to change the language settings without messing with the code.

    Thanks,

    Marina

  • This setting at the end of the rdl code can be set with the Language Property of the report in the properties window.

    To get there select Report from the dropdown box of controls in the properties window.

    Or select the square at the crossing point of the rulers (upper left of your report)

    success,

    Leo

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply