qml formatting of number not working
Solved
QML and Qt Quick
-
wrote on 28 Aug 2020, 20:05 last edited by
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.
-
wrote on 28 Aug 2020, 20:07 last edited by
Ah crap! I was missing parenthesis after Qt.locale. Should be Qt.locale().
1/2