SIToScaledString(Double, String, String, Double, Double) Method

Turns the given number of units into a textual representation with an appropriate unit scaling.

Definition

Namespace: Gemstone.Units
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.128 -- Release Build+d050cfc5563c89a1188cc3c6b2d417530856f490
public static string ToScaledString(
	double totalUnits,
	string unitName,
	string[]? symbolNames = null,
	double minimumFactor = 1E-24,
	double maximumFactor = 1E+24
)

Parameters

totalUnits  Double
Total units to represent textually.
unitName  String
Name of unit display (e.g., you could use "m/h" for meters per hour).
symbolNames  String  (Optional)
Optional SI factor symbol or name array to use during textual conversion, defaults to Symbols.
minimumFactor  Double  (Optional)
Optional minimum SI factor. Defaults to Yocto.
maximumFactor  Double  (Optional)
Optional maximum SI factor. Defaults to Yotta.

Return Value

String
A String representation of the number of units.

Remarks

The symbolNames array needs one string entry for each defined SI item ordered from least (Yocto) to greatest (Yotta), see Names or Symbols arrays for examples.

Exceptions

ArgumentOutOfRangeExceptionminimumFactor or maximumFactor is not defined in Factors array.

See Also