convert string to decimal

Stimulsoft Reports.Flex discussion
Locked
ksukat
Posts: 25
Joined: Mon Aug 13, 2012 7:05 pm

convert string to decimal

Post by ksukat »

Greetings,
I have 2 data fields that are passed into my report. (there are actually many).
I need to have (field1 / field2) * 100 displayed in a column. Here is the rub:
field1 and field2 are passed into the report as strings. Ie 7.35, 2.19 as strings.

How do I convert the string representation of the number to decimals so I can do the
calculation?

thanks.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: convert string to decimal

Post by Alex K. »

Hello,

Please try to use the following expression:
((decimal)field1 / (decimal)field2) * 100

Thank you.
Locked