Decimal Values

Hi Team,

I am multiplying 2 string values say 16.4 * 1.

Since its a string value i am assign my code is

Cint(String1)*Cint(String2)
I am storing this output in a double variable.
Expected output : 16.4
Actual Output is : 17

Help needed.

Hi,

Can you try CDbl instead of CInt?

Regards,

This is because you are converting to integer at the first place.
CInt will convert string to integer. In case of float the value will be converted to rounded value.
Instead of CInt , use CDbl for converting decimal values.

Thank you guys working fine.

1 Like