Enable automatic conversion of units for numeric features

Hello,

Pierre-Gilles had the idea of automatically converting the units of numeric features such as Duration, Rate or Distance.

Thus, if I have a Duration in seconds, it would display:

  • 35s
  • 99s => 01m39s
  • 3900s => 01h05m00s

We could add a checkbox in the feature configuration to enable or disable this mode.
Or even a MultiComboBox to select the usable units, e.g.:
I check minutes, hours and days but not weeks, months and years.
Thus my seconds will never be converted into months.

  • 864000s would not display « 1 week and 3 days and 00h00m00s Â» but « 240h00m00s Â».

Idea for presentation :

The original message from Pierre-Gilles :

I wonder whether it wouldn’t be better to force all devices to use the smallest unit (e.g., nm instead of mm or cm or m or km) and do a graphical conversion based on the value… but if we want to do that, it’s a big undertaking!

Well, the problem is that if a device sends seconds, you need to know that to multiply it by 1000…
It seems more than complicated and it forces doing a lot of calculations in all directions when sending data to Gladys if we’re talking in minutes and hours.

And it would force using units that we don’t necessarily want…

I don’t think the « Unit convertible to Â» is necessary, we just do it sensibly and display each unit neatly (1500 Wh becomes 1.5kWh, etc.), the user has nothing to do.

[quote=« AlexTrovato, post:2, topic:8213 Â»]
I wonder in this case whether it wouldn’t be better to force all devices to

1 Like

That means that potentially someone who only wants seconds, even with a high value, will no longer get what they want.

Similarly, we may end up with unwanted units; as I said, I don’t really want to be told in weeks or months, for example…

I’m having trouble seeing the use case, if you have a specific example I can help :slight_smile: 14563s doesn’t speak to anyone in my opinion…

No, indeed, but the '90s, yes…

Ok, if it’s really a vital issue, this behavior could be enabled during the dashboard configuration, but not on the device itself.

After that, it seems a bit far-fetched to me :sweat_smile: We’ll go for what’s best for the user, and the simplest; I’m not a fan of extreme configuration.

For now, let’s do without, in my opinion.

You’re the boss, do as you see fit and we’ll give you feedback.