I have the following line in my sitemap:
Default item=Units label="Units [JS(|parseFloat(input)):%.1f U]"
The item is a string object and I want to convert it to a number and print only the first decimal on the UI. I am trying to perform the conversion using the inlinen JS transformation.
However the transformation does not seem to work and I get an error in the log:
2025-02-14 16:05:19.527 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value '0.0' of item Units with format 'JS(|parseFloat(input)):%.1f U': f != java.lang.String
What am I doing wrong? Is someone able to help? Thanks