in reply to Print output looks wierd
You already use sprintf for formatting. Why don't you develop a full line template for your report like this;
# header printf "%4s %20s %20s %20s\n\n", "Year", "Balance", "Interest", "New B +alance"; .... # report (in while) printf "%4d %20.2f %20.2f %20.2f\n", $year, $StartAmountRounded,$Inter +estrounded, $NewBalancerounded;
Of course, the header can be done directly, using printf there is just for demonstration purposes.
Also, if you would provide a little standalone running script, preferably with use strict; and use warnings; you would get more answers to your problem as it is far easier to run a script and look at its output than to read the code only.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Print output looks wierd
by programmercarlito (Novice) on Mar 14, 2015 at 15:50 UTC | |
by hdb (Monsignor) on Mar 14, 2015 at 16:30 UTC |