Click or drag to resize

TimeToString(Int32, String, Double) Method

Converts the Time value into a textual representation of years, days, hours, minutes and seconds with the specified number of fractional digits given string array of time names.

Namespace: GSF.Units
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.207-beta+1781b796b2aa7a54013a031eb432fe4ccee31867
Syntax
public string ToString(
	int secondPrecision,
	string[] timeNames,
	double minimumSubSecondResolution = 0.001
)
View Source

Parameters

secondPrecision  Int32
Number of fractional digits to display for seconds.
timeNames  String
Time names array to use during textual conversion.
minimumSubSecondResolution  Double  (Optional)
Minimum sub-second resolution to display. Defaults to Milli.

Return Value

String
The string representation of the value of this instance, consisting of the number of years, days, hours, minutes and seconds represented by this value.
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionminimumSubSecondResolution is not less than or equal to Milli or minimumSubSecondResolution is not defined in Factors array.
Remarks

Set second precision to -1 to suppress seconds display.

timeNames array needs one string entry for each of the following names:
" year", " years", " day", " days", " hour", " hours", " minute", " minutes", " second", " seconds", "less than ".

See Also