Converting String variable to a Integer that supports decimal points

Currently have the following Assign:

strPostagePaid = row.Item(“PostagePaid”).ToString.Trim()

and I originally applied this to convert it to an integer:

intPostagePaid = CInt(strPostagePaid)

But the issue I have is it keeps on rounding the value. i.e. if its 0.58 then it rounds it to 1.00

Any ideas on how I can improve on this?

Hi,

Integer type cannot have decimal point.
Can you try to use Double type variable?

doubleVar = CDbl(strPostagePaid)

Regards,

1 Like

Thank you :slight_smile: works great

1 Like

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