12-26-2017 20:28
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

12-26-2017 20:28
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
I think I've found a bug with the Number.prototype.toFixed() method. It can be reproduced in Fitbit Studio by starting a new project with the Minimal template, and putting this in app/index.js:
let fixed = Number(0.1).toFixed(3) console.log(`${fixed} <-- expected 0.100 here `)
What actually gets logged to the console is:
0.1
Note that there are two abnormalities here:
- The toFixed() method should return '0.100'
- The rest of the string ('<-- expected 0.100 here')in the console.log call is not printed.
01-09-2018 16:35
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


01-09-2018 16:35
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Looks like the fix for this missed the release! It should be included in the next update! Thanks for raising this.
06-07-2018 12:34 - edited 06-07-2018 13:18
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

06-07-2018 12:34 - edited 06-07-2018 13:18
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I can confirm that this bug is still there in latest version (27.32.10.20) of Ionic. However, the bug is not present in Fitbit OS Simulator.
Testing on Ionic
index.js
console.log("91:" + parseFloat(91).toFixed(1));
console.log("91.0:" + parseFloat(91.0).toFixed(1)); console.log("91.5:" + parseFloat(91.5).toFixed(1)); console.log("'91':" + parseFloat("91").toFixed(1)); console.log("'91.0':" + parseFloat("91.0").toFixed(1)); console.log("'91.5':" + parseFloat("91.5").toFixed(1));
Console
91: 91. 91.0: 91. 91.5: 91.0 '91': 91. '91.0': 91. '91.5': 91.0
Testing on Fitbit OS Simulator
Console
91: 91.0 91.0: 91.0 91.5: 91.5 '91': 91.0 '91.0': 91.0 '91.5': 91.5

