about summary refs log tree commit diff stats
path: root/lib/Taurus/CLI.rakumod
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Taurus/CLI.rakumod')
-rw-r--r--lib/Taurus/CLI.rakumod15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/Taurus/CLI.rakumod b/lib/Taurus/CLI.rakumod
index 56ef889..a7759b0 100644
--- a/lib/Taurus/CLI.rakumod
+++ b/lib/Taurus/CLI.rakumod
@@ -1,3 +1,5 @@
+use Taurus::Seconds;
+
 use CSV::Parser;
 use Terminal::UI 'ui';
 use Terminal::ANSI::OO 't';
@@ -83,9 +85,9 @@ multi sub MAIN (
                 my $outgoing = .grep(*.[2] eqv "Outgoing Call").map(*.[4]).sum;
                 my $incoming = .grep(*.[2] eqv "Incoming Call").map(*.[4]).sum;
 
-                $p1.put: "%-*s %.2f hours".sprintf($fmt, "Outgoing:", $outgoing / 3600);
-                $p1.put: "%-*s %.2f hours".sprintf($fmt, "Incoming:",  $incoming / 3600);
-                $p1.put: "%-*s %.2f hours".sprintf($fmt, "Total:",  ($incoming + $outgoing) / 3600);
+                $p1.put: "%-*s %s".sprintf($fmt, "Outgoing:", seconds-to-str($outgoing));
+                $p1.put: "%-*s %s".sprintf($fmt, "Incoming:",  seconds-to-str($incoming));
+                $p1.put: "%-*s %s".sprintf($fmt, "Total:",  seconds-to-str($outgoing + $incoming));
                 $p1.put: "";
             }
         } elsif %meta<number> -> $num {
@@ -99,9 +101,9 @@ multi sub MAIN (
                 my $outgoing = .grep(*.[2] eqv "Outgoing Call").map(*.[4]).sum;
                 my $incoming = .grep(*.[2] eqv "Incoming Call").map(*.[4]).sum;
 
-                $p1.put: "%-*s %.2f hours".sprintf($fmt, "Outgoing:", $outgoing / 3600);
-                $p1.put: "%-*s %.2f hours".sprintf($fmt, "Incoming:", $incoming / 3600);
-                $p1.put: "%-*s %.2f hours".sprintf($fmt, "Total:", ($incoming + $outgoing) / 3600);
+                $p1.put: "%-*s %s".sprintf($fmt, "Outgoing:", seconds-to-str($outgoing));
+                $p1.put: "%-*s %s".sprintf($fmt, "Incoming:", seconds-to-str($incoming));
+                $p1.put: "%-*s %s".sprintf($fmt, "Total:", seconds-to-str($outgoing + $incoming));
                 $p1.put: "";
 
                 $p1.put: "%-*s %d".sprintf($fmt, "Declined:",
@@ -118,6 +120,7 @@ multi sub MAIN (
     ui.shutdown;
 }
 
+
 multi sub MAIN(
     Bool :$version #= print version
 ) is export { put "Taurus v" ~ $?DISTRIBUTION.meta<version>; }