From 4ffac12e4728ce506f48015500e217a9838f3b4b Mon Sep 17 00:00:00 2001 From: Irina Peshinskaya Date: Mon, 10 Nov 2014 11:52:57 +0200 Subject: [PATCH] MT#10061 Fix rounding for invoices. --- share/templates/invoice/default/invoice_template_aux.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/templates/invoice/default/invoice_template_aux.tt b/share/templates/invoice/default/invoice_template_aux.tt index 7be7ba5745..0e83145da6 100644 --- a/share/templates/invoice/default/invoice_template_aux.tt +++ b/share/templates/invoice/default/invoice_template_aux.tt @@ -132,7 +132,7 @@ base = 10; full = Math.int(amount / 100); # -2 because now amount is in cents, so we need to shift to signs amount, additional to current 2. - cent = ( ( amount - full ) * ( base.power( money_signs - 2) ) ); + cent = ( ( amount - full*100 ) * ( base.power( money_signs - 2) ) ); cents = String.new(cent); cents = cents.format("%.0f",cents); cents_format_string = "%0" _ money_signs _ "d";