print decimal values

Hi guys I'm trying to print average of 2 columns.

awk '{print ($1+$2)/2}' file.txt

Its printing average but not giving decimal values

its giving 3.05521e+08 instead of 305521....

I tried %f to print float values but not quiet connected

Could you help plz:confused:

awk '{printf "%f\n", ($1+$2)/2 }' file.txt

doesn't work ?

No
Its giving but not accurately
all values ending either with .5000.. or .00000....

like
135603981.500000
135604080.000000
135604672.500000

May be that is correct... what is your sample input?

yes, maybe that is correct, maybe you just need to format it to 1 or 2 decimal places instead

Yep thanx
really helpful