Click or drag to resize

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

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

Namespace: GSF.Units
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.207-beta+1781b796b2aa7a54013a031eb432fe4ccee31867
Syntax
public static string ToScaledString(
	double totalUnits,
	string format,
	string unitName,
	double minimumFactor = 1E-24,
	double maximumFactor = 1E+24
)
View Source

Parameters

totalUnits  Double
Total units to represent textually.
format  String
A numeric string format for scaled totalUnits.
unitName  String
Name of unit display (e.g., you could use "m/h" for meters per hour).
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.
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionminimumFactor or maximumFactor is not defined in Factors array.
Remarks
Symbols array is used for displaying SI symbol prefix for unitName.
See Also