From a8dc4a184e190ab23e96a2bfe133c9aea6af019d Mon Sep 17 00:00:00 2001 From: tetragon Date: Fri, 13 Oct 2006 17:31:13 +0000 Subject: Round displayed values in till breakdown git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@214 4979c152-3d1c-0410-bac9-87ea11338e46 --- bin/rc.pl | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bin') diff --git a/bin/rc.pl b/bin/rc.pl index 2daed931..32301e77 100755 --- a/bin/rc.pl +++ b/bin/rc.pl @@ -250,6 +250,7 @@ function money_round(m){ function custom_calc_total(){ |; my $subgen = 'document.forms[0].sub_sub.value = '; + my $toround = ''; foreach my $unit (@{$pos_config{'breakdown'}}) { # XXX Needs to take into account currencies that don't use 2 dp my $parsed = $form->parse_amount(\%pos_config, $unit); @@ -261,8 +262,12 @@ function custom_calc_total(){ document.forms[0].${subval}.value = document.forms[0].${calcval}.value * $parsed; |; $subgen .= "document.forms[0].${subval}.value * 1 + "; + $toround .= qq| + document.forms[0].${subval}.value = + money_round(document.forms[0].${subval}.value); |; } print $subgen . "0;"; + print $toround; print qq|document.forms[0].sub_sub.value = money_round(document.forms[0].sub_sub.value); document.forms[0].amount_cash.value = money_round( -- cgit v1.2.3