Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Awk Rounding 1

Status
Not open for further replies.

UCF87

Technical User
Feb 13, 2003
44
US
Is the a way to "turn off" rounding? When the amounts get up to 6 figures AIX rounds up when cents are > 50.

for FILE in `ls *.Amt`
do
awk '{e=substr($1,length($1)) $1;sum+=e}END{print sum}' $FILE >> TOTAL
done


Thanks in advance.
 
Try replacing the print with

printf("%8.2f",sum)

CaKiwi

"I love mankind, it's people I can't stand" - Linus Van Pelt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top