Two notes: 1. the variable OFMT controls the output of the print statement, which internally uses the C function sprintf to convert numbers to strings. If you use the printf statement, you can specify the format as in
printf "%.0f",$1 # or simply
2. The format specified by the OFMT variable affects only the printing of numbers. But if you try to print an input field as in
the output is not affected by OFMT even if $1 represents a numeric value, since variables and fields are considered strings in awk, unless the context forces them to be treated as numbers. A workaround to force awk to consider variables and fields as numbers is to add 0, for example the statement
force awk to consider $1 as a number, due to the presence of an arithmetic operator and in this case it is affected by the format specified by OFMT.