decimal.Parse

Stimulsoft Ultimate discussion
Post Reply
deestinee
Posts: 11
Joined: Tue Dec 17, 2019 7:26 am

decimal.Parse

Post 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.
Attachments
XML.xml
(158 Bytes) Downloaded 205 times
Report.mrt
(7.24 KiB) Downloaded 227 times
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: decimal.Parse

Post 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.
deestinee
Posts: 11
Joined: Tue Dec 17, 2019 7:26 am

Re: decimal.Parse

Post 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.
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: decimal.Parse

Post by Lech Kulikowski »

Hello,

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

Thank you.
deestinee
Posts: 11
Joined: Tue Dec 17, 2019 7:26 am

Re: decimal.Parse

Post by deestinee »

Hello,

I am using NET component.

Thank you.
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: decimal.Parse

Post by Lech Kulikowski »

Hello,

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

Thank you.
Attachments
Annotation 2020-05-21 221836.png
Annotation 2020-05-21 221836.png (34.14 KiB) Viewed 3066 times
Post Reply