saymedia / angularjs-humanize

AngularJS filters wrapping the 'humanize' library
MIT License
10 stars 6 forks source link

Use isNaN for all number tests #3

Closed russell closed 9 years ago

russell commented 9 years ago

This simplifies the code slightly, and it also allows humanise to do the conversion to the number type it expects.

The primary reason for doing this is floats are being skipped because they will never pass the test parseInt(input) !== input. But as a side effect strings that contain numbers will now also work.

apparentlymart commented 9 years ago

This looks reasonable to me. Thanks!

@snark would you agree?