Lets say we want to Convert/Parse
following string
string mystring = "221021290110000123452229211210282900128222900"
to an number
Of what type would this number be?
i tested Double.TryParse(mystring,out myBigNumber)
but i got an E+
number which i can't use for my mathematical operations because the modulo operation will result in a wrong number
You convert a string to a number by calling the Parse or TryParse method found on numeric types ( int , long , double , and so on), or by using methods in the System. Convert class. It's slightly more efficient and straightforward to call a TryParse method (for example, int.
Use the parseInt() function to convert a string to a number, e.g. const num1 = parseInt(str) . To extract a number from a string in TypeScript, call the replace() method, e.g. str.
var bigNumber = BigInteger.Parse(mystring);
See BigInteger.Parse
.
As far as I know BigInteger
is limited by the amount of memory you have available.
BigInteger is what you are looking for
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With