BigIntegerStatic: ToString

ToString

Returns a human readable string of characters representing the number.



 Public Function ToString(
	  ByVal x As BigInteger,
	  Optional ByVal format As String ) As String

Parameters

x
[ByVal] BigInteger. The BigInteger to create a string from.
format
[ByVal] Optional. String. The specific numerical format wish to have the number displayed as.

Return Values

String -  The numeric value of the number in the specified format.

Remarks

"X" and "x" for hex in either upper or lowercase. "B" or "b" for a binary representation of 1s and 0's. Everything else defaults to a decimal display.

The specifier can also contain a number of mininum digits to be displayed. If the value isnt long enough to reach the mininum digits, then leading 0's, 1's, or FFs will be added to the beginning of the output.

 Dim b As BigInteger
 Set b = BInt(-200)
 Debug.Print b.ToString("d8") ' -00000200
 Debug.Print b.ToString("d")  ' -200
 Debug.Print b.ToString("x8") ' ffffff38
 Debug.Print b.ToString("x")  ' ff38
 Debug.Print b.ToString("b8") ' 1111111100111000
 Debug.Print b.ToString("b")  ' 1111111100111000
 

If no format is specified, the default of "d" is used.

See Also

Project VBCorLib Overview Class BigIntegerStatic Overview BigIntegerStatic Properties BigIntegerStatic Methods TestBit TryParse