Reputation: 43
I am trying to display the following number, 40.0 by using this code:
Text{
id: txt
property int number: 40.0
text: number
x:94
y:213
font.family: "Helvetica"
font.bold:true
font.pointSize: 60
color:"#fff"
}
For some reason, only 40 is displaying, and no decimal. These are the other things I've tried so far:
str = QString::number(flat, 'f', 40.0);
var german = Qt.locale("de_DE");
var d;
d = Number.fromLocaleString(german, "40.0") // d == 40.0
Text {
Number(40.0).toLocaleString(Qt.locale("de_DE"))
}
Upvotes: 2
Views: 2930
Reputation: 7173
real
.Text {
id: txt
property real number: 40.1
text: {
return txt.number.toFixed(1)
}
}
Upvotes: 1