Skip to content

Commit

Permalink
Update pebble.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ELUTE committed Jun 20, 2014
1 parent 6a5b082 commit 035ead6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pebble.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function pebble (req, res) {
if (element) {
console.log(element, index);
var obj = {};
obj.sgv = (element.sgv / 18.01559).toFixed(2);
obj.sgv = (element.sgv / 18.01559).toFixed(1);
obj.bgdelta = (last ? (last.sgv - obj.sgv) : 0);
if ('direction' in element) {
obj.trend = directionToTrend(element.direction);
Expand Down

1 comment on commit 035ead6

@GrantKY
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With regard to the bgdelta field, I would suggest the toFixed(2) is applied to the bgdelta also e.g
obj.bgdelta = (last ? (last.sgv - obj.sgv).toFixed(2) : 0);
Therefore don't end up with something like "bgdelta":0.1999999999999993,

Please sign in to comment.