From 6cd6c7a37905398fa0f5c86468b5aeb735c096fc Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Wed, 2 Jan 2013 11:14:02 +0100 Subject: Numbers are printed with commas as thousands separators. --- source/pyAggr3g470r.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/pyAggr3g470r.py b/source/pyAggr3g470r.py index 6e320be3..20b0ea20 100755 --- a/source/pyAggr3g470r.py +++ b/source/pyAggr3g470r.py @@ -43,6 +43,9 @@ __license__ = "GPLv3" import os import re import datetime +import locale +locale.setlocale(locale.LC_ALL, 'en_US.utf8') + import cherrypy from mako.template import Template from mako.lookup import TemplateLookup @@ -130,8 +133,8 @@ class pyAggr3g470r(object): feeds = self.mongo.get_all_feeds() nb_mail_notifications = self.mongo.nb_mail_notifications() nb_favorites = self.mongo.nb_favorites() - nb_articles = self.mongo.nb_articles() - nb_unread_articles = self.mongo.nb_unread_articles() + nb_articles = locale.format("%d", self.mongo.nb_articles(), grouping=True) + nb_unread_articles = locale.format("%d", self.mongo.nb_unread_articles(), grouping=True) tmpl = lookup.get_template("management.html") return tmpl.render(feeds=feeds, nb_mail_notifications=nb_mail_notifications, \ nb_favorites=nb_favorites, nb_articles=nb_articles, \ -- cgit