Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Commit

Permalink
Calculator: Fix non-whole expression rewriting (#4241)
Browse files Browse the repository at this point in the history
* Fix non-whole expression rewriting.

* Add pixel to check for failure.
  • Loading branch information
pjhampton authored and bsstoner committed Jun 3, 2017
1 parent 3869ad1 commit 092124b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions share/goodie/calculator/calculator.js
Expand Up @@ -277,8 +277,7 @@ DDH.calculator = DDH.calculator || {};
return "* " + base + "." + (number < 10 ? "0" + percentage : percentage );
} else {
base += number / 100;
remainder = number % 100;
return "* " + base + "." + remainder;
return "* " + base;
}
},

Expand Down Expand Up @@ -857,6 +856,12 @@ DDH.calculator = DDH.calculator || {};
calculator("=");
} catch(_err) {
display.value = "";
DDG.pixel.fire(
'iafd',
'calculator', {
q: DDG.get_query_encoded()
}
);
}
}

Expand Down

0 comments on commit 092124b

Please sign in to comment.