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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

round off problem

Status
Not open for further replies.

kamilhus

Technical User
Jan 9, 2007
3
0
0
US
Hello, I was trying to calculate something. The main concept is that there is a number say a=50.5555333
and another number b=20.00
When I subtract b from a, I get lower than 30
Can anyone help me so that the computer takes all the numbers as significan. I mean I want to get 20.5555333
Thanks in advance
Kamil
 
Perhaps a problem with the output format, otherwise I don't see any problems...
Code:
awk -v a=50.5555333 -v b=20.00 -v OFMT=%.7f 'BEGIN{print a - b}'
...gives...
Code:
30.5555333
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top