Skip to content

Commit

Permalink
Merge pull request #9 in LFOR/fhirpath.js from bugfix/number-parse-fl…
Browse files Browse the repository at this point in the history
…oat-for-ie to master

* commit '1b0b3dedbafe0abbea2fbf79887f7ee30507888a':
  Using "Number.parseFloat" replaced with "parseFloat" for IE11
  • Loading branch information
plynchnlm committed May 4, 2020
2 parents a10b987 + 1b0b3de commit 4180fcd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
This log documents significant changes for each release. This project follows
[Semantic Versioning](http://semver.org/).

## [2.1.4] - 2020-05-04
### Fixed
- Using "Number.parseFloat" replaced with "parseFloat" for IE11

## [2.1.3] - 2020-04-28
### Changed
- Removed the need to exclude package "fs" when building
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fhirpath",
"version": "2.1.3",
"version": "2.1.4",
"description": "A FHIRPath engine",
"main": "src/fhirpath.js",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ engine.toDecimal = function(coll){
}
if(typeof v === "string") {
if(numRegex.test(v)){
return Number.parseFloat(v);
return parseFloat(v);
} else {
throw new Error("Could not convert to decimal: " + v);
}
Expand Down
2 changes: 1 addition & 1 deletion src/numbers.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ numberFns.isEquivalent = function(actual, expected) {
if(prec === 0){
return Math.round(actual) === Math.round(expected);
} else {
// Note: Number.parseFloat(0.00000011).toPrecision(7) === "1.100000e-7"
// Note: parseFloat(0.00000011).toPrecision(7) === "1.100000e-7"
// It does # of significant digits, not decimal places.
return roundToDecimalPlaces(actual, prec) ===
roundToDecimalPlaces(expected, prec);
Expand Down

0 comments on commit 4180fcd

Please sign in to comment.