Ignore:
Timestamp:
Jun 26, 2008, 8:25:29 PM (16 years ago)
Author:
OverTaker
Message:

List,TimeSpan.ToString()実装。
Console.WriteのObject型のオーバーロードを追加。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/ablib/src/Classes/System/TimeSpan.ab

    r275 r526  
    164164        End If
    165165    End Function
     166
     167    Override Function ToString() As String
     168        If Ticks < 0 Then
     169            Dim span = Negate() As TimeSpan
     170            Return ActiveBasic.Strings.SPrintf("-%d:%.2d:%.2d:%.2d.%.4d",
     171                New Int32(span.Days) ,New Int32(span.Hours), New Int32(span.Minutes), New Int32(span.Seconds), New Int32(span.Milliseconds))
     172        Else
     173            Return ActiveBasic.Strings.SPrintf("%d:%.2d:%.2d:%.2d.%.4d",
     174                New Int32(Days) ,New Int32(Hours), New Int32(Minutes), New Int32(Seconds), New Int32(Milliseconds))
     175        End If
     176    End Function
    166177   
    167178    Static Function FromTicks(ticks As Int64) As TimeSpan
Note: See TracChangeset for help on using the changeset viewer.