[codenameone-discussions] Re: Detect if a string is numeric - doesn't work on iOS

2017-08-07 Thread Shai Almog
It's possible the exception is thrown correctly for Integer. Floating point parsing is much harder. -- You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group. To unsubscribe from this group and stop receiving emails from it, send an email to

[codenameone-discussions] Re: Detect if a string is numeric - doesn't work on iOS

2017-08-07 Thread nickkoirala
I agree that using exceptions for normal flow isn't ideal but none of the regex I tried worked with the Codename One regex class properly. I've tried again and found a simple Regex did the job for my simplified use case. The number is generated by a count of user actions so is always an integer

[codenameone-discussions] Re: Detect if a string is numeric - doesn't work on iOS

2017-08-07 Thread Dave Dyer
It depends on your actual application, but I would recommend writing your own filter to pass only tokens that are acceptable to you. You shouldn't depend on the arbitrary definition of "number". Would "Infinity" be acceptable? parseDouble thinks so. -- You received this message because you