Uploaded image for project: 'Cubby'
  1. Cubby
  2. CUBBY-222

NumberValidatorで全角の「1」なども数値として認識されてしまう

XMLWordPrintable

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major Major
    • 2.0.0-beta2
    • Affects Version/s: 2.0.0-beta1
    • Component/s: None
    • None

      BigDecimalを使用すると全角の「1」やアラビア数字、指数なども数値と認識されてしまいます。
      Cubby2.0からはNumberValidatorは正規表現等で半角英数のみ有効にしたほうがいいかなと思いました。

      http://java.sun.com/javase/ja/6/docs/ja/api/java/lang/Character.html#isDigit(char)

      private static final Pattern pattern = Pattern.compile("^[-+]?[0-9]+[.]?[0-9]*$");
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            agata agata
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: