iOS icon indicating copy to clipboard operation
iOS copied to clipboard

Values in complications not displayed correctly

Open normand198 opened this issue 2 years ago • 2 comments

iOS device model, version and app version Model Name: iPhone 12 Pro Software Version: 17.1 App version: 2023.7 (2023.471)

Home Assistant Core Version 2023.10.5

Describe the bug Some values in Watch complications are not displayed correctly. Seems to be related to rounding/epsilon error, but there is no workaround. Using round or format functions will not do anything, because the value will always be converted to float.

Example values and how they are displayed: 9.8 -> 9.8000…1 8.8 -> 8.8000…1 9.3 -> 9.3000…1 9.2 -> 9.1999…9 Or use any sensor that outputs a value like above

To Reproduce

  1. Go to Apple Watch settings in Home Assistant iOS App
  2. Add a new complication (for example image circular)
  3. select a template (for example open gauge text)
  4. copy/paste in any field: {% set value = 9.8 %} {{ value }}
  5. the output will show as 9.8000000…1

Or try with format: {% set value = 9.8 %} {{ '%.2f' | format(value) }} Outputs same as 5)

Expected behavior Rounding error should not be visible or the use of format function should be possible.

Screenshots IMG_6012

normand198 avatar Oct 31 '23 11:10 normand198