Skip to content

Commit

Permalink
Regex correction for calculation with negative numbers.
Browse files Browse the repository at this point in the history
  • Loading branch information
PauloAK committed Oct 22, 2020
1 parent 6bc4bb4 commit d3ef585
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Is possible to apply a custom parsing for each column content. By default, is ap

Regex:
```
/[\d|.|,]+/
/[\d|\-|.|,]+/
```

#### Example
Expand Down
2 changes: 1 addition & 1 deletion dist/columnHeatmap.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/columnHeatmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
}
} else {
// Get only numbers from the cell, (with float points)
let numbers = $(td).text().match(/[\d|.|,]+/)[0];
let numbers = $(td).text().match(/[\d|\-|.|,]+/)[0];

data[col.toString()]['values'].push(parseFloat(numbers));
}
Expand Down

0 comments on commit d3ef585

Please sign in to comment.