Formatting dollar outputs ($8.50 instead of 8.5)

This commit is contained in:
tonnesen 2002-10-29 22:53:28 +00:00
parent 8b21eb69e8
commit f810c4f2b4
2 changed files with 4 additions and 2 deletions

View File

@ -37,7 +37,7 @@ BORDER=0 src="/images/delete-mem.gif">
<b>Item Type:</b> <TMPL_VAR NAME="itemtype"><br>
<b>URL:</b> <TMPL_VAR NAME="url"><br>
<b>Loan Length:</b> <TMPL_VAR NAME="loanlength"><br>
<b>Rental Charge:</b> <TMPL_VAR NAME="rentalcharge"><br>
<b>Rental Charge:</b> $<TMPL_VAR NAME="rentalcharge"><br>
<b>Classification:</b> <TMPL_VAR NAME="classification"><TMPL_VAR NAME="dewey"><TMPL_VAR NAME="subclass"><br>
<b>ISBN:</b> <TMPL_VAR NAME="isbn"><br>
<b>Publisher:</b> <TMPL_VAR NAME="publishercode"> <br>
@ -81,7 +81,7 @@ BORDER=0 src="/images/delete-mem.gif">
<b>Last Borrower 1:</b> <TMPL_VAR NAME="card0"><br>
<b>Last Borrower 2:</b> <TMPL_VAR NAME="card1"><br>
<b>Current Branch:</b> <TMPL_VAR NAME="holdingbranch"><br>
<b>Replacement Price:</b> <TMPL_VAR NAME="replacementprice"><br>
<b>Replacement Price:</b> $<TMPL_VAR NAME="replacementprice"><br>
<b>Item lost:</b> <TMPL_VAR NAME="itemlost"><br>
<b>Paid for:</b> <TMPL_VAR NAME="paidfor"><br>
<b>Notes:</b> <TMPL_VAR NAME="itemnotes"><br>

View File

@ -58,6 +58,7 @@ if ($dewey <= 0){
}
$dewey=~ s/\.$//;
$data->{'dewey'}=$dewey;
$data->{'rentalcharge'}=sprintf "%.02f", $data->{'rentalcharge'};
my @results;
@ -77,6 +78,7 @@ foreach my $item (@items){
$item->{'withdrawn'}=~ s/0/No/;
$item->{'withdrawn'}=~ s/1/Yes/;
$item->{'replacementprice'}+=0.00;
$item->{'replacementprice'}=sprintf "%.02f", $item->{'replacementprice'};
my $year=substr($item->{'timestamp0'},0,4);
my $mon=substr($item->{'timestamp0'},4,2);
my $day=substr($item->{'timestamp0'},6,2);