-
Contributing Member
Problem with awk
Question:
Will awk perform decimal point calculaiton or not?
plz help
Sharif.S
-
Contributing Member
Re: Problem with awk
Why not?
Refer the following URL:
Awk - A Tutorial and Introduction - by Bruce Barnett
-------------------
suresh
-
Contributing Member
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
-
Contributing Member
Re: Problem with awk
can someone pls look in to this..
-
Contributing Member
Re: Problem with awk
Guys i have found the solution for the abv question..
Thanks!
Sharif.S
-
Expert Member
Re: Problem with awk
Whats the solution sharif?
why that occurred?
post it. we too will learn.
Last edited by Barbie; 01-17-2007 at 01:42 AM.
-
Expert Member
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
-
Contributing Member
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
-
Expert Member
Re: Problem with awk
Hi,
Sheri,
That was really i nice solution with complex query.
Thanks to post solution.
Regards
Nikhil
-
Contributing Member
Re: Problem with awk
Hey Nikhil,
Just a change i want to mention. am sharif not sheri!!!!!!
Cheers,
Sharif
-
Expert Member
Re: Problem with awk
oh oh
Yap i mistyped that
fine
cheers!!!!!
Nikhil Rattan
-
Contributing Member
Re: Problem with awk
No Issues Nikhil..
Cheers
Sharif
-
Expert Member
Re: Problem with awk
hi,
Sorry Sharif,
I mistyped that . I will take care about that for future.
Regards
Nikhil Rattan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules