Ensure the daily totals per customer have double digits in the hours value
authorBorja Lopez <borja@codigo23.net>
Thu, 08 Feb 2018 21:37:25 +0100
changeset 69 522b15adbbcd
parent 68 0c473bfc59f3
child 70 3cbf9f8e714e
Ensure the daily totals per customer have double digits in the hours value when showing verbose details of the stamps
stamper/stamper.py
--- a/stamper/stamper.py	Thu Feb 01 08:29:06 2018 +0100
+++ b/stamper/stamper.py	Thu Feb 08 21:37:25 2018 +0100
@@ -283,6 +283,8 @@
                     if not self.wants_seconds or self.wants_seconds == 'false':
                         # remove the seconds part from the string representation
                         tc_total = ':'.join(tc_total.split(':')[:-1])
+                        # ensure hours show double digits
+                        tc_total = tc_total.zfill(5)
                     customer_day_totals.append(tc+': '+tc_total)
                 print(', '.join(customer_day_totals))
                 if len(customer_day_totals) > 1: