summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authortetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2006-10-13 17:31:13 +0000
committertetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2006-10-13 17:31:13 +0000
commita8dc4a184e190ab23e96a2bfe133c9aea6af019d (patch)
tree64309763fdac820dbdeca57f5506c80d8330dcc3 /bin
parent0dd0dab1bda350998569a4fcbf2e81f109e144a9 (diff)
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
Diffstat (limited to 'bin')
-rwxr-xr-xbin/rc.pl5
1 files changed, 5 insertions, 0 deletions
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(