Prepare for your Next Interview
This is a discussion on Problem with awk within the Unix/Linux forums, part of the Operating Systems category; Question: Will awk perform decimal point calculaiton or not? plz help Sharif.S...
|
|||
|
Problem with awk
Question:
Will awk perform decimal point calculaiton or not? plz help Sharif.S |
| The Following User Says Thank You to sharifhere For This Useful Post: | ||
| Sponsored Links |
|
|||
|
Re: Problem with awk
Why not?
Refer the following URL: Awk - A Tutorial and Introduction - by Bruce Barnett ------------------- suresh |
|
|||
|
Re: Problem with awk
then wat cud be the reason for this output:-
shell awk 'BEGIN{sum=0;} {sum=sum+(99999.99); print sum; }' filed Output 100000 200000 300000 400000 500000 600000 700000 800000 900000 1e+06 1.1e+06 1.2e+06 1.3e+06 1.4e+06 |
|
|||
|
Re: Problem with awk
Hi SHerif,
As i saw u posted a very intersting query .After that you yourself found a solution for that also. That's great but if u found a solution please share with us. Then we also come to know about the same problem's solution. Regards Nikhil Rattan |
|
|||
|
Re: Problem with awk
In awk there is settings parameter called OFMT which holds/defines the output format of numbers. by default its "%.6g". By increasing it we can achive desired results.
sorry guys yesterday i was with urgent task to complete, so cudn't able to post solution. Thanks, Sharif |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem in Decryption | ramamaru | Windows | 2 | 10-13-2008 10:19 AM |
| div tag problem... | psuresh1982 | JavaScript | 3 | 02-03-2007 09:05 AM |
| Problem for my post.... | psuresh1982 | Suggestions & Feedback | 1 | 12-14-2006 04:32 AM |
| One more Mathematical problem..? | psuresh1982 | Brainteasers | 2 | 11-17-2006 07:13 AM |
| Postman problem. | jamesravid | Brainteasers | 4 | 11-13-2006 01:04 AM |