[htmltmpl] How to Keep Trailing 0 in Outuput
Brought to you by:
samtregar
|
From: Wei, A. Ju-H. <aj...@in...> - 2011-08-08 14:38:50
|
Hi,
Tried to create the output so that it preserves the trailing 0s when I print the result out. It looks like that my perl does just as that.
$value=sprintf("%0.2f", $value);
Print_log $value. "\n";
However, when I tried to get that to print using the html template, which is currently set to an XML format, the trailing 0 that were in the value from the log files disappeared.
Here is the output of what is in the log file
150766.81
84735.48
3704.94
3084.17
7715.67
4435.80
The first 5 displayed as it is above, but the 6th one was displayed as 4435.8. How can I keep the print out as it is on html-plate? Here is what I have in the html-template call:
my $main_tmpl = HTML::Template->new(filename => 'xml_generate.xml');
# Find all parms in the template file and fill them with matching global parm values
my @parameter_names = $main_tmpl->param();
$main_tmpl->param( total => $total; );
Thanks for your help.
Alice
|