diff --git a/app.py b/app.py index 4028c90..b19a027 100644 --- a/app.py +++ b/app.py @@ -105,9 +105,12 @@ def get_template_fields(progress): title = request.args.get("title") + progress_text = progress + scale = 100 try: scale = int(request.args.get("scale")) + progress_text = int(progress / scale * 100) except (TypeError, ValueError): pass @@ -126,6 +129,7 @@ def get_template_fields(progress): "title_color": request.args.get("color"), "scale": scale, "progress": progress, + "progress_text": progress_text, "progress_width": progress_width, "progress_color": request.args.get("progress_color"), "progress_background": request.args.get("progress_background"), diff --git a/templates/progress.svg b/templates/progress.svg index c364c1e..3cbcad4 100644 --- a/templates/progress.svg +++ b/templates/progress.svg @@ -75,11 +75,11 @@ {% if show_text %} {% if show_shadow %} - {{prefix}}{{progress}}{{suffix}} + {{prefix}}{{progress_text}}{{suffix}} {% endif %} - {{prefix}}{{progress}}{{suffix}} + {{prefix}}{{progress_text}}{{suffix}} {% endif %}