[SOLVED] Qt int to String in qml aka sprintf in c
-
Hi,
I need to print a number in qml in this way (with three digits), for example
3 -> 003
10 -> 010
etc...How I can do this in qml, with this code?
@
property int val: 10Text {
text: val
}
@ -
Hi,
AFAIK there's no direct way to do this. But you could write a function in C++ or in JavaScript to do that.
For JS way something like "this":http://stackoverflow.com/questions/1127905/how-can-i-format-an-integer-to-a-specific-length-in-javascript