Returns the TimeSpan value rounded
to the precision specified in the constructor then trimmed to the length specified here.
Namespace: CleanCode.DataAssembly: CleanCode (in CleanCode.dll) Version: 1.2.3.0 (1.2.03)
Syntax
Parameters
- length
- Type: System Int32
The display length, a value between -9 and +7 inclusive.
Return Value
A string representation of a TimeSpan rounded and padded with zeroes.Remarks
- If the length is greater than the precision the result is filled to the right with zeroes to that length.
- If the length is less than the precision the result is truncated to that length (so you have lost the benefit of rounding).
- The milliseconds of a TimeSpan object occupies seven characters so you may at most specify a length of 7.
- If the precision is specified as zero, the milliseconds are not shown at all, so calling this method would be identical to calling ToString .
- If the length is 0, all milliseconds are suppressed but the decimal point is displayed.
- If the length is negative, you start trimming the decimal point, then the seconds then minutes then hours. These take a total of nine characters so you may specify up to -9.
See Also