How to deal with long numbers?

Hi,
I have two numbers to subtract, using below formula. But it does not work for the numbers that are longer than 9 digits. How can I solve my problem?

CInt(row.Item(“Number 1”).ToString)-CInt(row.Item(“Number 2”).ToString)

Thanks,
Aysegul

1 Like

Hi @aysyavuz

Integer type variables cannot hold 9 digit large numbers. For those large numbers you have to use double data type. To convert to double, use CDBL instead of CINT

CDBL(row.item(“Number”).ToString)

3 Likes

Hi
the reason default int will int32 but we need int64 for long
Kindly try with this
Convert.ToInt64(row(“Number1”).ToString)-Convert.ToInt64(row(“Number2”).ToString)

Cheers @aysyavuz

1 Like

Thanks a lot, it works.

Aysegul

1 Like

Cheers @aysyavuz

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