Operator: round

I'm trying to round a variable saved as a decimal number to two decimal places with an app in Rule Machine...

  • Select Operation: variable math
  • Operator: round

It's not rounding the number, I'm still getting something like 16 decimal places. I think that at some point this rule would ask me for the number of decimal places to round to, but I'm not seeing it.

Edit: Actually, what it's doing now is rounding it to an integer value (zero decimal places). I'd like to use two decimal places, though.

What I do is:

  • multiply by 100
  • round
  • divide by 100

Genius! Thank-you!

1 Like

Download the Hubitat app