Thousand separator . and not ,

Stimulsoft Reports.WEB discussion
_Andy!
Posts: 8
Joined: Sat Dec 17, 2022 4:49 pm

Thousand separator . and not ,

Post by _Andy! »

Following format function gives a , as result for the thousand separator in English Language.

Code: Select all

Format("{0:N2}",Result.OrderLineSL_Price)
Example:
Actual situation: 1,017.50 €
Target situation: 1.017,50 €

I can´t use the standard functionalities of the Stimulsoft Report Designer, because the decimal places will be export in serveral variants from my ERP system.
I have to use the format functions. Do you have an overview over all possibilites (help page) ? Thank you for your support.
Attachments
Settings.jpg
Settings.jpg (120.86 KiB) Viewed 2583 times
Lech Kulikowski
Posts: 6198
Joined: Tue Mar 20, 2018 5:34 am

Re: Thousand separator . and not ,

Post by Lech Kulikowski »

_Andy!
Posts: 8
Joined: Sat Dec 17, 2022 4:49 pm

Re: Thousand separator . and not ,

Post by _Andy! »

Ok, thank you for the links. But that doesn´t solve my problem. Can you give me an overview for the Format functions?
What´s the right format function for this use case?
Lech Kulikowski
Posts: 6198
Joined: Tue Mar 20, 2018 5:34 am

Re: Thousand separator . and not ,

Post by Lech Kulikowski »

Hello,

You can find information about the format function at the following link:
https://learn.microsoft.com/en-us/dotne ... ew=net-7.0
https://learn.microsoft.com/en-us/dotne ... at-strings

Thank you.
_Andy!
Posts: 8
Joined: Sat Dec 17, 2022 4:49 pm

Re: Thousand separator . and not ,

Post by _Andy! »

I don´t find a function which solves my problem:

Code: Select all

Format("{0:N2}",Result.OrderLineSL_Price)
I tried several formulas.
Target situation: 1.017,50 €

Target:
no change if the culture will be changed from DE to US for example.
Thousand separator and decimal separator won´t be changed.

Can you help me ? Thank you.
Lech Kulikowski
Posts: 6198
Joined: Tue Mar 20, 2018 5:34 am

Re: Thousand separator . and not ,

Post by Lech Kulikowski »

Hello,

Please try to use:
{String.Format(System.Globalization.CultureInfo.CreateSpecificCulture("en-US"),"{0:N2}",Variable1)}
or
{Replace(Format("{0:N2}",Variable1), ",", ".")}

Thank you.
_Andy!
Posts: 8
Joined: Sat Dec 17, 2022 4:49 pm

Re: Thousand separator . and not ,

Post by _Andy! »

The result with {Replace(Format("{0:N2}",Variable1), ",", ".")} is 48.220.00.
My Target is to show 48.220,00

{String.Format(System.Globalization.CultureInfo.CreateSpecificCulture("en-US"),"{0:N2}",Variable1)} gives an error message. (see screenshot1 in attachment.)

Do you have another suggestions?
Attachments
Screenshot1.jpg
Screenshot1.jpg (75.83 KiB) Viewed 2422 times
Lech Kulikowski
Posts: 6198
Joined: Tue Mar 20, 2018 5:34 am

Re: Thousand separator . and not ,

Post by Lech Kulikowski »

Hello,

There are no other standard ways to change it.
As a way, you can add your own function in which set format as you need.

Thank you.
_Andy!
Posts: 8
Joined: Sat Dec 17, 2022 4:49 pm

Re: Thousand separator . and not ,

Post by _Andy! »

Hello @Lech Kulikowski,
which function is that?
I tried several functions. The thousand separator will be changed in every case. That has to be possible in my opinion. I don´t know what else can i try.
Lech Kulikowski
Posts: 6198
Joined: Tue Mar 20, 2018 5:34 am

Re: Thousand separator . and not ,

Post by Lech Kulikowski »

Hello,

> which function is that?

We mean, you can implement your OWN function and add to the dictionary, which will format your values as you need.

Thank you.
Post Reply