From 8118c9edf2c8f2871c7741aea32657bfc319d41b Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Fri, 27 Dec 2019 18:00:57 +0100 Subject: [PATCH] Fix float display --- cotisations/templates/cotisations/facture.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cotisations/templates/cotisations/facture.html b/cotisations/templates/cotisations/facture.html index df29a2cb..dc9b31f7 100644 --- a/cotisations/templates/cotisations/facture.html +++ b/cotisations/templates/cotisations/facture.html @@ -87,7 +87,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% if articlesformset %} var prices = {}; {% for article in articlelist %} -prices[{{ article.id|escapejs }}] = {{ article.prix }}; +prices[{{ article.id|escapejs }}] = "{{ article.prix }}"; {% endfor %} var template = `Article :   @@ -121,7 +121,7 @@ function update_price(){ if (article == '') { continue; } - article_price = prices[article]; + article_price = parseFloat(prices[article].replace(',', '.')); quantity = document.getElementById( 'id_form-' + i.toString() + '-quantity').value; price += article_price * quantity;