Hi
I'm using this code i a sh file:
ude_temp="$( cat /sys/bus/w1/devices/28-0000056xxxba/w1_slave | sed -n 's/^.*\(t=[^ ]*\).*/\1/p' | sed 's/t=//' | awk '{x=$1}END{print(x/1000)}')"
echo $ude_temp
This will echo the temperatur like this (left row):
25.0625 --> 25.06
10.125 --> 10.13
0.5 --> 0.50
0 --> 0.00
-0.5 --> -0.5
-10.125 --> -10.13
-25.0625 --> -25.06
But how can I change the output to 2 decimals (right row)?