Help with ROUND function.

nginx27

New member
So I'm making a macro that shows cpu temperature.
I came up with this
Code:
cat /sys/class/thermal/thermal_zone0/temp
However, this gave me 5 digits string. e.g. 32800
I converted it into decimal (32800.0) but I can't make it 32.8 using ROUND function.
Am I doing it wrong?? 🤔
 

Endercraft

Moderator (& bug finder :D)
Divide it by 1000, then either do something like ROUND([lv=var], 1) or use text manipulation to remove the excess digits.
 

mapriex

Active member
I converted it into decimal (32800.0) but I can't make it 32.8 using ROUND function.

I thought using ROUND([lv=var], 1) alone will shorten the value and move the decimal.
FYI.
You can round the numbers behind the coma. So if you have a number with 32 Thousand and then coma 0. You round the 0 to 0.
First you need to set up the right unit to round the decimal value you want.

With negative values you can round the value on the left side of the coma, but you will get like: 32800.0 to 33000.0.
 
Top