Skip to content
This repository was archived by the owner on Aug 27, 2025. It is now read-only.

Commit 48328e3

Browse files
committed
Fixed javascript math bug
1 parent 76a4bb1 commit 48328e3

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

appinfo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"versionLabel": "1.5",
2+
"versionLabel": "1.5.1",
33
"uuid": "015f546b-4f84-4648-a956-cb846df7a820",
44
"appKeys": {
55
"value": 0

src/js/pebble-js-app.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ function getPrice() {
1818
var value;
1919
var output;
2020
var micro;
21-
rates = response = JSON.parse(req.responseText);
21+
rates = response = JSON.parse(req.responseText);
2222
value = response.value;
2323
console.log("Asking price is " + value + ".");
24-
micro = value*1000000;
25-
output = "1 DOGE" + "\n = \n" + micro + " " + "\xB5" + "BTC";
24+
micro = parseFloat(value) * parseFloat(1000000);
25+
console.log(micro);
26+
var display = micro.toFixed(2);
27+
output = "1 DOGE" + "\n = \n" + display + " " + "\xB5" + "BTC";
2628
console.log(output);
2729
var message = {
2830
"value": output.toString()

0 commit comments

Comments
 (0)