![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Rounding off to the next whole number | damansingh | Shell Programming and Scripting | 2 | 07-17-2008 06:18 AM |
| Very ANNOYING Problem - Please Help | shadow0001 | Shell Programming and Scripting | 7 | 03-12-2008 06:28 PM |
| Rounding problem | shash | UNIX for Dummies Questions & Answers | 2 | 01-18-2007 05:33 AM |
| Rounding off using BC. | noodlesoup | Shell Programming and Scripting | 3 | 09-11-2006 12:38 AM |
| a very annoying problem | Stormpie | UNIX for Dummies Questions & Answers | 2 | 04-24-2002 12:29 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Annoying rounding issue in awk
Hello
I am getting this very annoying issue in awk: Code:
awk '{a=12825;b=a*1.25; print b}' test
16031.2
I think the issue only happens on bigger numbers. What can I do to get passed this? Thanks by advance |
|
||||
|
Alright
This doesn't work: Code:
awk '{ a="12825";
b="16031.25";
c=a*1.25;
if (b != c) printf "%5.2f\t%5.2f\n",b,c
}' test
|
| Sponsored Links | ||
|
|