question

JassimAlRahma-9056 avatar image
0 Votes"
JassimAlRahma-9056 asked Paul-5034 answered

Convert 20 digits string to number


Hi,

How can I convert a 20 digits (BIGINT) from string to a number?

I tried Int64, long and long but non worked for me

 ulong.Parse("78103100000002874465")

Kindly help..

Thanks,
Jassim

dotnet-csharp
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Paul-5034 avatar image
2 Votes"
Paul-5034 answered

That value exceeds the maximum value that a ulong/UInt64 can hold, but you can use a BigInteger:

 System.Numerics.BigInteger.Parse("78103100000002874465")
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.