Complex number format: "F2", "N2", "G5"
Imports System.Numerics
Module Example
Public Sub Main()
Dim c() As Complex = { New Complex(17.3, 14.1),
New Complex(-18.9, 147.2),
New Complex(13.472, -18.115),
New Complex(-11.154, -17.002) }
Dim formats() As String = { "F2", "N2", "G5" }
For Each c1 As Complex In c
For Each format As String In formats
Console.WriteLine("{0}: {1} ", format, c1.ToString(format))
Next
Console.WriteLine()
Next
End Sub
End Module
Related examples in the same category