akinncar / react-native-mask-text

🎭 A React Native and Expo library to mask text and inputs
MIT License
404 stars 36 forks source link

unMask returning NaN when used with type currency #313

Open TiagoSimionato opened 3 weeks ago

TiagoSimionato commented 3 weeks ago

Steps to reproduce

  1. Call the function unMask with any non-empty string not containing a number.
    unMask('a', 'currency')
    unMask('(', 'currency')
  2. NaN is returned as a string

Expected behaviour

The function should return '0', like when it's called with an empty string, so it can still be masked again.

Actual behaviour

The function returns 'NaN'

Environment

react-native-mask-text

Version: npm version or "main" 0.14.2