Disallows implicit conversion from 'string' to 'double'

Hi everyone, I’m s t r u g g l i n g trying to overcome the debugging error “Disallows implicit conversion from ‘string’ to ‘double’”

Currently I have -

VariableX = row(“BilledAmount”).ToString
VariableY = row(“IssuedAmount”).ToString
row(“Outstanding Balance”) = VariableY - VariableX

It results in the error. I have tried
Convert.ToDouble(VariableY - VariableX)
and also Parsing the string to double but I get the same error message for both.

However, when I do
Cint(row(“BilledAmount”).ToString) - Cint(row(“IssuedAmount”).ToString)
the formula works.

However I do not want it in integer form as I need the decimal places.

Could anyone assist please? Thank you!

Hello @cookiedough

Try this

Convert.ToDouble(VariableY) - Convert.ToDouble(VariableX)

or

Cdbl(VariableY) - Cdbl(VariableX)

image

Hi @cookiedough

Do Like this and try

Cdec(row(“BilledAmount”).ToString) - CDec(row(“IssuedAmount”).ToString)

Regards
Sudharsan

HI @cookiedough

You can try with also

Double.Parse(VariableY) - Double.Parse(VariableX) 

image

Regards
Gokul

This worked! Thank you so much.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.