[gnome-clocks] fix of issue #86: display an extra digit for timezones that differ by 1/4 or 3/4 hours



commit d4b240232e6c84106d6bae4b38a145473de06e84
Author: ja-nko <ja_nko mailbox org>
Date:   Wed Mar 18 21:15:18 2020 +0100

    fix of issue #86: display an extra digit for timezones that differ by 1/4 or 3/4 hours
    
    printf now show truncates the diff after the second digit.
    
    https://gitlab.gnome.org/GNOME/gnome-clocks/issues/86

 src/world.vala | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/world.vala b/src/world.vala
index c2ee1a6..4fe513b 100644
--- a/src/world.vala
+++ b/src/world.vala
@@ -511,7 +511,11 @@ private class Tile : Gtk.ListBoxRow {
         var diff_string = "%.0f".printf (diff.abs ());
 
         if (diff != Math.round (diff)) {
-            diff_string = "%.1f".printf (diff.abs ());
+            if (diff * 2 != Math.round (diff * 2)) {
+                diff_string = "%.2f".printf (diff.abs ());
+            } else {
+                diff_string = "%.1f".printf (diff.abs ());
+            }
         }
 
         // Translators: The time is the same as the local time


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]