Decimal point/comma problems

DomiDomi Belgium
edited 3:12PM in FastReport .NET
Hi,

I pass a list of number in string variable to a report; in my report, I use the ToDecimal function to convert them into numbers to perform operations, totals, ... but all are multiplyed by 100 :

"12.45" >> 1.245,00

Is there any way to avoid this ? there is no parameter in the ToDecimal function like in C#

thanks in advance,
Domi.

Comments

  • Hello!

    Within FastReport .NET text expressions, you can directly pass the *InvariantCulture* culture to the standard *Convert.ToDecimal* method:

    [Convert.ToDecimal([MyField], System.Globalization.CultureInfo.InvariantCulture)]

    It’s also more reliable to pass numbers to the report in a numeric type (decimal / double) rather than as strings.

This discussion has been closed.