• Post Reply Bookmark Topic Watch Topic
  • New Topic

Non Numeric Characters  RSS feed

 
LaTeef Lusk
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is there a way that you could check for non numeric characters with the exception of currency formatting. ($, .)
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> is there a way that you could check for non numeric characters with the exception of currency formatting. ($, .)

use a regex to compare, but you might be better off using a JFormattedTextField,
and there are other ways you can bar certain characters from input
 
Campbell Ritchie
Sheriff
Posts: 55351
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And check out the methods of the java.lang.Character class. There are lots called things like isDigit(). They might help.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!