Search Results

Search: Posts Made By: beow
63,616
Posted By beow
OK, thanks, it explains the problem. Solved it by...
OK, thanks, it explains the problem. Solved it by just substituting with sed:

$ echo "2.5" | sed 's/\./,/' | awk '{temp = $1 - 1; printf("%f\n", temp)}'
1,500000

That's enough for my needs in...
63,616
Posted By beow
Wow, that was fast... :) However doesn't...
Wow, that was fast... :)

However doesn't work on my Mac with its awk

$ echo "2.5" | awk '{temp = $1 - 1; printf("%f\n", temp)}'
1,000000

$ awk --version
awk version 20070501


any other...
63,616
Posted By beow
awk string to number conversion
Can someone explain whats happening here:

$ awk 'BEGIN {print (2.5 - 1)}'
1,5


2.5 - 1 is correctly calculated to 1,5 (using european locale)

$ echo "2.5" | awk '{temp = $1 - 1; print...
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 06:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy