I have a simple file with some numerical values in it:
2018-11-15 14:07:22 37.672 20.553 15.90 4.0
2018-11-17 09:15:46 37.519 20.692 13.80 4.0
2018-11-17 20:33:18 37.540 21.712 9.50 4.2
2018-11-18 05:18:02 37.391 20.516 0.00 4.3
2018-11-18 06:06:44 37.556 20.268 0.00 4.3
2018-11-19 05:56:51 37.565 20.678 14.60 4.2
2018-11-19 13:05:56 37.179 20.580 6.10 5.1
2018-11-19 16:16:41 37.167 20.571 0.10 4.0
I just want to print the third and the fourth column with one decimal. For that reason I do:
awk '{printf "%.1f %.1f\n",$3,$4}' myfile
The problem in that it gives me the values with zeros in the decimal part (this output is just an example, it is not the output of the input):
37,0 20,0
37,0 20,0
40,0 28,0
34,0 26,0
40,0 20,0
34,0 26,0
34,0 26,0
39,0 24,0
37,0 20,0
39,0 24,0
36,0 21,0
37,0 20,0
37,0 20,0
37,0 20,0
I really don't know what is going on...
My locale is:
decimal_point=","
thousands_sep="."
grouping=-1;-1
numeric-decimal-point-wc=44
numeric-thousands-sep-wc=46
numeric-codeset="UTF-8"
locale -k LC_NUMERICoutput?