Skip to content

Commit

Permalink
Fixed and issue with the numerical filter
Browse files Browse the repository at this point in the history
  • Loading branch information
leongersen committed Aug 22, 2014
1 parent 3a5e1bb commit bdf2e24
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion wNumb.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,16 @@ var
// Add the number
output += input;

// Trim all non-numeric characters (allow '.' and '-');
output = output.replace(/[^0-9\.\-.]/g, '');

// The value contains no parse-able number.
if ( output === '' ) {
return false;
}

// Covert to number.
output = Number(output.replace(/[^0-9\.\-.]/g, ''));
output = Number(output);

// Run the user-specified post-decoder.
if ( decoder ) {
Expand Down

0 comments on commit bdf2e24

Please sign in to comment.