aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/demos/stocqt/content/StockInfo.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/quick/demos/stocqt/content/StockInfo.qml')
-rw-r--r--examples/quick/demos/stocqt/content/StockInfo.qml9
1 files changed, 4 insertions, 5 deletions
diff --git a/examples/quick/demos/stocqt/content/StockInfo.qml b/examples/quick/demos/stocqt/content/StockInfo.qml
index 3c5ee196f2..88f540fa09 100644
--- a/examples/quick/demos/stocqt/content/StockInfo.qml
+++ b/examples/quick/demos/stocqt/content/StockInfo.qml
@@ -73,7 +73,7 @@ Rectangle {
font.family: Settings.fontFamily
font.pointSize: 28
font.weight: Font.DemiBold
- text: parseFloat(Math.round(root.stock.stockPrice * 100) / 100).toFixed(2);
+ text: parseFloat(root.stock.stockPrice).toFixed(2);
}
}
@@ -99,7 +99,7 @@ Rectangle {
color: root.stock.stockPriceChanged < 0 ? "#d40000" : "#328930"
font.family: Settings.fontFamily
font.pointSize: 18
- text: parseFloat(Math.round(root.stock.stockPriceChanged * 100) / 100).toFixed(2);
+ text: parseFloat(root.stock.stockPriceChanged).toFixed(2);
}
Text {
@@ -110,9 +110,8 @@ Rectangle {
font.pointSize: 18
font.weight: Font.DemiBold
text: "(" +
- Math.abs(Math.round(
- root.stock.stockPriceChanged /
- (root.stock.stockPrice - root.stock.stockPriceChanged) * 100)) / 100 +
+ parseFloat(root.stock.stockPriceChanged /
+ (root.stock.stockPrice - root.stock.stockPriceChanged) * 100.0).toFixed(2) +
"%)"
}
}