DEV Community

Discussion on: Help me with the code, most of the test cases passed but when a negative number encounter it return its positive value.

Collapse
 
jrogers8835 profile image
jrogers8835

I did mention it doesn't work for decimals. Regex is useful. Use this site for testing and see what you can find from google to account for decimals.
regexr.com/
Hint: '.' Is a special character