progress rounding
authorRadek Czajka <rczajka@rczajka.pl>
Fri, 6 Dec 2024 13:47:56 +0000 (14:47 +0100)
committerRadek Czajka <rczajka@rczajka.pl>
Fri, 6 Dec 2024 13:47:56 +0000 (14:47 +0100)
src/annoy/models.py
src/annoy/templates/annoy/banner_crisis.html

index f6dd827..0d88792 100644 (file)
@@ -85,6 +85,10 @@ class Banner(models.Model):
             return 0
         return (self.progress or 0) / self.target * 100
 
             return 0
         return (self.progress or 0) / self.target * 100
 
+    @property
+    def progress_percent_pretty(self):
+        return int(self.progress_percent)
+
     def update_progress(self):
         # Total of new payments during the action.
         # This definition will need to change for longer timespans.
     def update_progress(self):
         # Total of new payments during the action.
         # This definition will need to change for longer timespans.
index dbbb34e..1398ee5 100644 (file)
@@ -35,7 +35,7 @@
          <div class="progress-box">
            <div>
              <div class="l-checkout__support__bar">
          <div class="progress-box">
            <div>
              <div class="l-checkout__support__bar">
-               <span data-label="{{ banner.progress_percent|floatformat:'0' }}%" style="width: {% localize off %}{{ banner.progress_percent }}%{% endlocalize %};"></span>
+               <span data-label="{{ banner.progress_percent_pretty }}%" style="width: {% localize off %}{{ banner.progress_percent }}%{% endlocalize %};"></span>
              </div>
            </div>
          </div>
              </div>
            </div>
          </div>