Imports System.Numerics
Imports System
Imports System.Globalization
Module Example
Public Sub Main()
Dim number As BigInteger = BigInteger.Parse("~9999999", New BigIntegerFormatProvider)
Console.WriteLine(number.ToString(New BigIntegerFormatProvider))
Console.WriteLine(number)
End Sub
End Module
Public Class BigIntegerFormatProvider : Implements IFormatProvider
Public Function GetFormat(ByVal formatType As Type) As Object Implements IFormatProvider.GetFormat
If formatType Is GetType(NumberFormatInfo) Then
Dim numberFormat As New NumberFormatInfo
numberFormat.NegativeSign = "~"
Return numberFormat
Else
Return Nothing
End If
End Function
End Class