Numeral-js icon indicating copy to clipboard operation
Numeral-js copied to clipboard

numeral.validate doesn't work on negative numbers

Open fdelbos opened this issue 10 years ago • 11 comments

numeral.validate("-1234") returns false

fdelbos avatar Oct 08 '14 14:10 fdelbos

What am I missing on this one -- numeral has no validate function as far as I can see?

jwlrs avatar Nov 03 '14 21:11 jwlrs

@joelarson4 it does in develop branch @fdelbos I have opened a pull request that fixes this bug

zeusdeux avatar Nov 09 '14 09:11 zeusdeux

Normally I don't like to "bump" issue because it's just noise but it's been over 2 years on this one. Thanks.

djensen47 avatar Jan 24 '17 09:01 djensen47

stumbled upon this bug today

numeral.validate('-50','en') = false

Ludevik avatar May 11 '17 13:05 Ludevik

Bump as well. It would be really nice to have a validate function that worked with negatives.

chartzoge avatar Jul 21 '17 17:07 chartzoge

Bump as well. This library is not complete without this feature.

Goran-n avatar Nov 30 '17 14:11 Goran-n

Sorry, but: WTF :)

numeral.validate(-10) = false ???

super-kamil avatar Mar 14 '18 12:03 super-kamil

@super-kamil https://github.com/zeusdeux/Numeral-js/commit/c620b580d533063354fc31fc05d867e56609c100

There’s a many year old PR with this change but I doubt it’s been merged.

zeusdeux avatar Mar 15 '18 19:03 zeusdeux

Is there any chance of merging this? I'm using Numeral.js in a large application as part of i18next stack (https://www.i18next.com/formatting.html). I have to add a custom validation now before passing it to Numeral.js

super-kamil avatar Mar 19 '18 16:03 super-kamil

  1. Took me a while to figure out, but that's still an issue..

winkelsdorf avatar May 28 '19 19:05 winkelsdorf

It's 2022, any updates on this issue?

ashley00101010 avatar Aug 26 '22 09:08 ashley00101010