Solved qml formatting of number not working
-
I have this code:
console.log(typeof(powersupplyCurrent.dataValue)) var num = powersupplyCurrent.dataValue.toLocaleString(Qt.locale, 'f', 2) console.log(num)
The output:
qml: number qml: 25.592187881469727
The formatting is supposed to allow formatting of the output.
I don't understand why it is not working.
-
Ah crap! I was missing parenthesis after Qt.locale. Should be Qt.locale().