Returns the TimeSpan value rounded to the precision specified in the constructor then trimmed to the length specified here.Namespace: CleanCode.Data
Assembly: CleanCode (in CleanCode.dll) Version: 188.8.131.52 (1.2.03)
public string ToString( int length )
Public Function ToString ( _ length As Integer _ ) As String
public: String^ ToString( int length )
- Type: System Int32
The display length, a value between -9 and +7 inclusive.
Return ValueA string representation of a TimeSpan rounded and padded with zeroes.
This method first rounds the TimeSpan to the specified precision, then trims to the length indicated.
- 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.