UtilValueToString Method

Converts a double value to a string with an appropriate number of digits. Optionally uses scientific notation for large numbers (|value| > 999), and for small numbers that would require more than maxNumberOfDecimals decimals to display two significant digits.

Definition

Namespace: DHI.Mike1D.Generic
Assembly: DHI.Mike1D.Generic (in DHI.Mike1D.Generic.dll) Version: 25.0.0.0 (11.1.1.1111)
C#
public static string ValueToString(
	double value,
	bool useScientificNotationForLargeNumbers = true,
	bool useScientificNotationForSmallNumbers = true,
	int maxNumberOfDecimals = 10,
	int minNumberOfDecimals = 2
)

Parameters

value  Double
The numeric value to convert to string.
useScientificNotationForLargeNumbers  Boolean  (Optional)
If true, use scientific notation for large numbers; otherwise, use standard numeric format.
useScientificNotationForSmallNumbers  Boolean  (Optional)
If true, small numbers that would require more than maxNumberOfDecimals decimals are shown in scientific notation; otherwise, they are shown as "0.000".
maxNumberOfDecimals  Int32  (Optional)
Maximum number of decimals to use in the output string. Default is 10.
minNumberOfDecimals  Int32  (Optional)
Minimum number of decimals to use in the output string. Default is 2.

Return Value

String

[Missing <returns> documentation for "M:DHI.Mike1D.Generic.Util.ValueToString(System.Double,System.Boolean,System.Boolean,System.Int32,System.Int32)"]

See Also