Use NumberFormatInfo to parse a BigInteger : BigInteger « Data Types « VB.Net






Use NumberFormatInfo to parse a BigInteger

 

Imports System.Numerics
Imports System
Imports System.Globalization
Module Example
   Public Sub Main()


        Dim fmt As New NumberFormatInfo()
        fmt.NegativeSign = "~"
        
        Dim number As BigInteger = BigInteger.Parse("~9999999", fmt)
        Console.WriteLine(number.ToString(fmt))
        Console.WriteLine(number)
   End Sub
End Module

   
  








Related examples in the same category

1.Create BigInteger structure using the values in a byte array.
2.Convert BigInteger to Byte Array back and forth
3.Create BigInteger using a Decimal value.
4.Create BigInteger structure using a double-precision floating-point value.
5.Create BigInteger structure using a 32-bit signed integer value.
6.Create BigInteger structure using a 64-bit signed integer value.
7.Create BigInteger structure using a single-precision floating-point value.
8.Create BigInteger structure using an unsigned 32-bit integer value.
9.Create BigInteger with an unsigned 64-bit integer value.
10.Represents an arbitrarily large signed integer.
11.Create BigInteger from long value
12.Use CType to convert double to BigInteger
13.Create BigInteger from
14.Parse string to BigInteger
15.BigInteger.Pow
16.BigInteger.Multiply
17.Adding value to BigInteger
18.Write the BigInteger value to a byte array
19.Restore the BigInteger value from a Byte array
20.Convert the Int16 value to a byte array
21.Pass byte array to the BigInteger constructor
22.Convert byte array to BigInteger
23.Convert negative value to byte array and then use it to create BigInteger
24.Parse Hex number to BigInteger
25.Convert BigInteger to String
26.Convert Long value to BigInteger
27.Convert Short to byte array
28.BigInteger.Abs Method get the absolute value of a BigInteger
29.BigInteger.Add Method Adds two BigInteger values and returns the result.
30.BigInteger.Compare Method Compares two BigInteger values
31.Implements the generic IComparable
32.Compares BigInteger to other data type
33.Divides one BigInteger value by another and returns the result.
34.BigInteger Division Operator
35.BigInteger.Equals Method
36.BigInteger Greater Than Operator
37.Compare with Int64.MaxValue
38.Using Int32.MaxValue
39.Using UInt64.MaxValue
40.BigInteger.Greater Than Or Equal
41.Finds the greatest common divisor of two BigInteger values.
42.BigInteger.LeftShift Operator Shifts a BigInteger value a specified number of bits to the left.
43.BigInteger calculation
44.BigInteger.Less Than Operator
45.Compare with Int64.MaxValue
46.BigInteger.Less Than Or Equal Operator
47.Compare with UInt64.MaxValue
48.BigInteger.Log Method Returns the natural (base e) logarithm of a specified number.
49.BigInteger.Max Method Returns the larger of two BigInteger values.
50.BigInteger.Min Method Returns the smaller of two BigInteger values.
51.BigInteger.ModPow Method Performs modulus division on a number raised to the power of another number.
52.BigInteger.Multiply Method Returns the product of two BigInteger values.
53.BigInteger.Negate Method Negates a specified BigInteger value.
54.BigInteger.OnesComplement Operator Returns the bitwise one's complement of a BigInteger value.
55.BigInteger.Parse Method Converts string to BigInteger
56.Implements IFormatProvider
57.BigInteger.Parse Method (String, NumberStyles)
58.Parse string with white space and sign to BigInteger
59.string interpreted as hexadecimal
60.NumberStyles.AllowLeadingWhite Or NumberStyles.AllowTrailingWhite
61.NumberStyles.AllowLeadingSign
62.BigInteger.Parse Method (String, NumberStyles, IFormatProvider)
63.Call parse with default values of style and provider supporting tilde as negative sign
64.Call parse with only AllowLeadingWhite and AllowTrailingWhite
65.Call parse with only AllowHexSpecifier
66.Call parse with only NumberStyles.None
67.BigInteger.Pow Method Raises a BigInteger value to the power of a specified value.
68.BigInteger.Remainder Method Performs integer division on two BigInteger values and returns the remainder.
69.BigInteger.RightShift Operator Shifts a BigInteger value a specified number of bits to the right.
70.BigInteger.Subtract Method Subtracts one BigInteger value from another and returns the result.
71.BigInteger.ToByteArray Method Converts a BigInteger value to a byte array.
72.BigInteger.ToString (IFormatProvider)
73.BigInteger to String format: X
74.BigInteger.Parse
75.Format BigInteger: "C", "D", "D25", "E", "E4", "e8", "F0"
76.Format BigInteger: "G", "N0", "P", "R", "X", "0,0.000"
77.Format BigInteger: "#,#.00#;(#,#.00#)"
78.BigInteger.ToString Method (String, IFormatProvider)
79.Standard format specifiers
80.BigInteger.TryParse Method Tries to convert string to BigInteger
81.BigInteger.TryParse Method (String, NumberStyles, IFormatProvider, BigInteger)
82.Call TryParse with default values of style and provider
83.Call TryParse with the default value of style and a provider supporting the tilde as negative sign.
84.Call TryParse with only AllowLeadingWhite and AllowTrailingWhite.
85.Call TryParse with AllowHexSpecifier and a hex value
86.Call TryParse with AllowHexSpecifier and a negative hex value.
87.Call TryParse with only NumberStyles.None
88.Call TryParse with NumberStyles.Any and a provider for the fr-FR culture
89.Call TryParse with NumberStyles.Any and a provider for the fr-FR culture
90.BigInteger to Byte conversion.
91.BigInteger to Decimal conversion.
92.Convert BigInteger to Double
93.Reference Double.MaxValue
94.BigInteger to Int64 conversion.
95.BigInteger to SByte conversion.
96.BigInteger to Single conversion.
97.BigInteger to UInt16 conversion.
98.BigInteger to UInt32 conversion.
99.BigInteger to UInt64 conversion.
100.Explicit Decimal to BigInteger conversion
101.Conversion of a Double to a BigInteger
102.Conversion of a Single object to a BigInteger value.