Complex<T>.ToString Method

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.9.0

Overload List

ToString() Converts the numeric value of this instance to its equivalent string representation.
ToString(IFormatProvider) Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information.
ToString(String) Converts the numeric value of this instance to its equivalent string representation using the specified format.
ToString(String, IFormatProvider) Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information.

ToString

Converts the numeric value of this instance to its equivalent string representation.
C#
public override string ToString()

Return Value

String
The string representation of the value of this instance.

ToString(IFormatProvider)

Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information.
C#
public string ToString(
	IFormatProvider provider
)

Parameters

provider  IFormatProvider
An IFormatProvider that supplies culture-specific formatting information.

Return Value

String
The string representation of the value of this instance.

ToString(String)

Converts the numeric value of this instance to its equivalent string representation using the specified format.
C#
public string ToString(
	string? format
)

Parameters

format  String
A format string.

Return Value

String
The string representation of the value of this instance.

Exceptions

FormatException

format is invalid.

ToString(String, IFormatProvider)

Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information.
C#
public string ToString(
	string? format,
	IFormatProvider? provider
)

Parameters

format  String
A format string.
provider  IFormatProvider
An IFormatProvider that supplies culture-specific formatting information.

Return Value

String
The string representation of the value of this instance.

Implements

IFormattable.ToString(String, IFormatProvider)

Remarks

Uses algebraic notation, such as 1.5 - 2.5i, with component formatting supplied by format and provider. If the imaginary component is zero, only the real component is written. This differs from Microsoft's generic complex pair notation.

The current parsing APIs do not guarantee acceptance of this presentation format. Serialize the components separately when a round trip is required.

Exceptions

FormatException

format is invalid.

See Also