Skip to content

Commit

Permalink
Strip common currency symbols from number parsing.
Browse files Browse the repository at this point in the history
  • Loading branch information
duffyjp authored May 24, 2023
1 parent a2a8ea5 commit 42cdafe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dentropize.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ function dentropize() {
return reverse ? -1 : 1;
} else {

// If the values parse as Numbers (strip commas)
let number = Number(x.replace(/,/g, '')) - Number(y.replace(/,/g, ''));
// If the values parse as Numbers
let number = Number(x.replace(/[$¥£,]/g, '')) - Number(y.replace(/[$¥£,]/g, ''));
if (!isNaN(number)) return number;

// If the values parse as Date or Time
Expand Down

0 comments on commit 42cdafe

Please sign in to comment.