Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Awk > rounding up (or...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 7 Topic 2104 of 2297
Post > Topic >>

rounding up (or down) issue

by Farid Hamjavar <hamjavar@[EMAIL PROTECTED] > Dec 19, 2007 at 09:32 AM

Greetings,

I have data lines in  a file like these whose
components add up to 100:

1.73   0.45   98.72
1.88   23.11  75.01
16.88  0.88   82.24



Yet, when attempting to round down (or up)
resulting data will not be 100 in total:

e.g. 2nd row , rounded up:
2   24   75    = 101

e.g. 2nd row , rounded down:
1   23   75    = 99


I need to round them up (or down) for re****ting
purpose in which the line show up like:

2%     24%    75%   = 101%



How does one get round this?
i.e. Any way to get 100 after rounding up (or down)?


Thanks,
Farid
 




 7 Posts in Topic:
rounding up (or down) issue
Farid Hamjavar <hamjav  2007-12-19 09:32:09 
Re: rounding up (or down) issue
Janis Papanagnou <Jani  2007-12-19 18:04:02 
Re: rounding up (or down) issue
Grant <g_r_a_n_t_@[EMA  2007-12-20 06:52:38 
Re: rounding up (or down) issue
Ed Morton <morton@[EMA  2007-12-19 23:43:59 
Re: rounding up (or down) issue
Bill Marcum <marcumbil  2007-12-19 14:34:46 
Re: rounding up (or down) issue
Ed Morton <morton@[EMA  2007-12-19 23:40:14 
Re: rounding up (or down) issue
Ed Morton <morton@[EMA  2007-12-19 23:53:33 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Jul 6 20:46:44 CDT 2008.