From b98cbde880ce8147a33ac31c0eb37fdbd8dc3d51 Mon Sep 17 00:00:00 2001 From: rangi Date: Wed, 7 Jun 2006 02:42:51 +0000 Subject: [PATCH] Adding a sprintf to format the fields involving currency to 2 decimal places --- admin/categorie.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/admin/categorie.pl b/admin/categorie.pl index 3fb91150ab..1453236c86 100755 --- a/admin/categorie.pl +++ b/admin/categorie.pl @@ -102,10 +102,10 @@ if ($op eq 'add_form') { enrolmentperiod => $data->{'enrolmentperiod'}, upperagelimit => $data->{'upperagelimit'}, dateofbirthrequired => $data->{'dateofbirthrequired'}, - enrolmentfee => $data->{'enrolmentfee'}, + enrolmentfee => sprintf("%.2f",$data->{'enrolmentfee'}), overduenoticerequired => $data->{'overduenoticerequired'}, issuelimit => $data->{'issuelimit'}, - reservefee => $data->{'reservefee'}, + reservefee => sprintf("%.2f",$data->{'reservefee'}), category_type => $data->{'category_type'}, "type_".$data->{'category_type'} => " SELECTED ", ); @@ -146,10 +146,10 @@ if ($op eq 'add_form') { enrolmentperiod => $data->{'enrolmentperiod'}, upperagelimit => $data->{'upperagelimit'}, dateofbirthrequired => $data->{'dateofbirthrequired'}, - enrolmentfee => $data->{'enrolmentfee'}, + enrolmentfee => sprintf("%.2f",$data->{'enrolmentfee'}), overduenoticerequired => $data->{'overduenoticerequired'}, issuelimit => $data->{'issuelimit'}, - reservefee => $data->{'reservefee'}, + reservefee => sprintf("%.2f",$data->{'reservefee'}), category_type => $data->{'category_type'} ); # END $OP eq DELETE_CONFIRM @@ -178,10 +178,10 @@ if ($op eq 'add_form') { enrolmentperiod => $results->[$i]{'enrolmentperiod'}, upperagelimit => $results->[$i]{'upperagelimit'}, dateofbirthrequired => $results->[$i]{'dateofbirthrequired'}, - enrolmentfee => $results->[$i]{'enrolmentfee'}, + enrolmentfee => sprintf("%.2f",$results->[$i]{'enrolmentfee'}), overduenoticerequired => $results->[$i]{'overduenoticerequired'}, issuelimit => $results->[$i]{'issuelimit'}, - reservefee => $results->[$i]{'reservefee'}, + reservefee => sprintf("%.2f",$results->[$i]{'reservefee'}), category_type => $results->[$i]{'category_type'}, toggle => $toggle ); push @loop, \%row; -- 2.39.5