How can I convert generic values which are extracted from a website to Decimals?

Hey there, I want to convert Variables of Generic type extracted from a website to Decimal values and perform calculations.
I tried “Assign activity” and NewDecimalValue=ExtractedValueFromWebsite.ToDecimal [Encountered a compiler error -“Overload resolution failed because no accessible ‘To decimal’ accepts his number of arguments.”]
and tried others as well CDbl(number) and number.Convert.ToDouble, Nothing works for me :frowning:
Values extracted from the website are of this format Example: “$45.07”
Please, can someone help me out with the above problem. Thanks in advance.

Hi @Duwa,

Your string value
StrValue=“$45.07”

DoubleValue=Convert.ToDouble(StrValue.ToString().Replace("$",""))

Regards,
Arivu

1 Like

Hey… Thanks for the quick reply.
I am still getting an error - Cannot Assign from type ‘System.Double’ to type ‘System.Int32’ in Assign activity ‘Assgin’.
I believe its something to do in variable pane.

Hi @Duwa,

I hope you assigning the value into interger variable.

Try to change it to double in tha variable panel.

Regards,
Arivu

1 Like