App development - capabilities value formatting to local localization/formatting rules

Hi all

I have a some capabilities for my devices, and I’m struggling with correct formatting of numbers.
To be more specific, I’m looking for a way to apply formatting to large numbers.

VALUE (raw): 1000000.00 (example: 1 million with two decimals)
English format: 1000000.00 - which is how it’s display in the devices info

For my localization, danish in this example - local formatting: 1.000.000,00 is way more readable.
Thousand seperator: “.” (dot), and decimal seperator ‘,’ (comma)

this.setCapabilityValue(“x_capability”, inverterData.Power)

Does this community know a way to apply number formatting to numbers in Homey? I would like to support this for my app where values are displayed. I need the capability to still be number - so raw-values are applied in flows. But for the presentation of the values, I would like to display localized formatting with local-format applied. Same could apply for DateTime, yyyy-mm-dd vs dd-mm-yyyy.

I am aware of this:
this.setCapabilityOptions(“x_capability”, { “units”: { “en” : “kWh” }, “decimals”: 3 );

I don’t think there is a way to set the format. All numbers in code have to use the . as the decimal, but i presume the Homey language or location will determine how they are presented to users.

Yes, I am suspecting that to be true.

I will try and add local hints/text support, maybe this will set locale and the format will change.

Support for formatting of numbers and date could be a lovely feature from Homey :slight_smile: