TimeDuration.st
changeset 16478 d2938d9d8d25
parent 16462 9f1d678f9e64
child 16479 9c0562f22996
--- a/TimeDuration.st	Wed May 21 14:33:38 2014 +0200
+++ b/TimeDuration.st	Wed May 21 17:28:49 2014 +0200
@@ -576,6 +576,58 @@
 
 !TimeDuration methodsFor:'converting'!
 
+asFixedPoint
+    "answer the duration is seconds"
+
+    ^ FixedPoint numerator:timeEncoding denominator:1000 scale:4 
+
+    "
+        (10 milliseconds)  asFixedPoint
+    "
+!
+
+asFloat
+    "answer the duration is seconds"
+
+    ^ timeEncoding / 1000.0
+
+    "
+        (10 milliseconds)  asFloat
+    "
+!
+
+asFraction
+    "answer the duration is seconds"
+
+    ^ timeEncoding / 1000
+
+    "
+        (10 milliseconds)  asFraction
+    "
+!
+
+asInteger
+    "answer the duration is seconds"
+
+    ^ self getSeconds
+!
+
+asLongFloat
+    "answer the duration is seconds"
+
+    ^ timeEncoding / 1000q
+
+    "
+        (10 milliseconds)  asLongFloat
+    "
+!
+
+asNumber
+    "answer the duration is seconds"
+
+    ^ self getSeconds
+!
+
 asTime
     "return a Time object from the receiver."
 
@@ -1097,11 +1149,11 @@
 !TimeDuration class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/TimeDuration.st,v 1.68 2014-05-16 06:59:19 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/TimeDuration.st,v 1.69 2014-05-21 15:28:49 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/TimeDuration.st,v 1.68 2014-05-16 06:59:19 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/TimeDuration.st,v 1.69 2014-05-21 15:28:49 stefan Exp $'
 ! !