Page 1 of 1

decimal.Parse

Posted: Tue May 12, 2020 3:12 pm
by deestinee
Hello, I´m running the latest version of Stimulsoft designer 2020.2.3 and having problem with decimal.Parse function. If I trie to convert string (containing number) to decimal it shows null. Attached is a test report. Thank you.

Re: decimal.Parse

Posted: Wed May 13, 2020 1:27 pm
by Lech Kulikowski
Hello,

You should the following code
{Decimal.Parse(Card.Test, new System.Globalization.CultureInfo("en-GB"))}
or
set the Culture property of the report and
{Decimal.Parse(Card.Test)}

https://docs.microsoft.com/en-us/dotnet ... etcore-3.1

Thank you.

Re: decimal.Parse

Posted: Mon May 18, 2020 8:58 am
by deestinee
Hello,

unfortunately neither method is working. When I trie following code {Decimal.Parse(Card.Test,System.Globalization.CultureInfo("en-GB"))}
I get this error: "The type or namespace name 'CultureInfo' does not exist in the namespace System.Globalization".
When I trie the other way it is still showing null instead of a number.

Re: decimal.Parse

Posted: Mon May 18, 2020 7:30 pm
by Lech Kulikowski
Hello,

Please clarify which components are you use (NET, Web, JS, ect)?

Thank you.

Re: decimal.Parse

Posted: Thu May 21, 2020 1:53 pm
by deestinee
Hello,

I am using NET component.

Thank you.

Re: decimal.Parse

Posted: Thu May 21, 2020 8:18 pm
by Lech Kulikowski
Hello,

Please check the following expression:
{Decimal.Parse(Card.Test, new System.Globalization.CultureInfo("en-GB"))}

Thank you.