#BUGFIX by cg
authorClaus Gittinger <cg@exept.de>
Mon, 14 Jan 2019 18:22:25 +0100
changeset 23602 fcf3d6f2f944
parent 23601 07a4b950046b
child 23603 f944a38585db
#BUGFIX by cg class: AbstractTime comment/format in: #printOn:format:language: changed: #addBasicPrintBindingsTo:language:
AbstractTime.st
--- a/AbstractTime.st	Thu Jan 10 19:15:53 2019 +0100
+++ b/AbstractTime.st	Mon Jan 14 18:22:25 2019 +0100
@@ -644,7 +644,6 @@
     "Modified: 1.7.1996 / 15:15:49 / cg"
 ! !
 
-
 !AbstractTime methodsFor:'abstract'!
 
 hours
@@ -1556,7 +1555,7 @@
     aDictionary at:#milliF1 put:((micros asFixedPoint:1) / 1000).
     aDictionary at:#milliF2 put:((micros asFixedPoint:2) / 1000).
     aDictionary at:#milliF3 put:((micros asFixedPoint:3) / 1000).
-    aDictionary at:#milliF4 put:((nanos asFixedPoint:3) / 1000000).
+    aDictionary at:#milliF4 put:((nanos asFixedPoint:4) / 1000000).
 
     aDictionary at:$J put:(s := micros printString).
     aDictionary at:#micro put:s.
@@ -1565,7 +1564,7 @@
     aDictionary at:#microF1 put:((nanos asFixedPoint:1) / 1000).
     aDictionary at:#microF2 put:((nanos asFixedPoint:2) / 1000).
     aDictionary at:#microF3 put:((nanos asFixedPoint:3) / 1000).
-    aDictionary at:#microF4 put:((picos asFixedPoint:3) / 1000000).
+    aDictionary at:#microF4 put:((picos asFixedPoint:4) / 1000000).
 
     aDictionary at:#nano put:(s := nanos printString).
     aDictionary at:#nano9 put:(s leftPaddedTo:9 with:$0).
@@ -1599,14 +1598,18 @@
       (TimeDuration fromMicroseconds:30) printStringFormat:'%(milliF2)ms'
       (TimeDuration fromMicroseconds:30) printStringFormat:'%(milliF3)ms'
       (TimeDuration fromMicroseconds:30) printStringFormat:'%(milliF4)ms'
+      (TimeDuration fromMicroseconds:3) printStringFormat:'%(milliF4)ms'
+      (TimeDuration fromNanoseconds:300) printStringFormat:'%(milliF4)us'
 
       (TimeDuration fromNanoseconds:30) printStringFormat:'%(microF1)us'
       (TimeDuration fromNanoseconds:30) printStringFormat:'%(microF2)us'
       (TimeDuration fromNanoseconds:30) printStringFormat:'%(microF3)us'
       (TimeDuration fromNanoseconds:30) printStringFormat:'%(microF4)us'
+      (TimeDuration fromNanoseconds:3) printStringFormat:'%(microF4)us'
+      (TimeDuration fromPicoseconds:300) printStringFormat:'%(microF4)us'
     "
 
-    "Modified: / 25-05-2018 / 12:16:05 / Claus Gittinger"
+    "Modified (comment): / 14-01-2019 / 18:21:38 / Claus Gittinger"
 !
 
 addPrintBindingsTo:aDictionary
@@ -1800,6 +1803,17 @@
 
     |dict|
 
+"/ is this a good idea?    
+"/    aFormatString = '%h:%m:%s' ifTrue:[
+"/        "/ this is so common...
+"/        aStream nextPutAll:(self hours printStringLeftPaddedTo:2 with:$0).
+"/        aStream nextPutAll:':'.
+"/        aStream nextPutAll:(self minutes printStringLeftPaddedTo:2 with:$0).
+"/        aStream nextPutAll:':'.
+"/        aStream nextPutAll:(self seconds printStringLeftPaddedTo:2 with:$0).
+"/        ^ self 
+"/    ].
+    
     dict := IdentityDictionary new.
     self addPrintBindingsTo:dict language:languageString.
 
@@ -1815,7 +1829,8 @@
      Time now printOn:Transcript format:'minutes:%M seconds:%S'. Transcript cr.
     "
 
-    "Modified: 22.2.1996 / 16:58:30 / cg"
+    "Modified: / 22-02-1996 / 16:58:30 / cg"
+    "Modified: / 14-01-2019 / 18:22:12 / Claus Gittinger"
 !
 
 printStringFormat:aFormatString