×
Namespaces

Variants
Actions

Talk:Value of TextField.NUMERIC is limited to 10 digits in Series 40 (Known Issue)

From Nokia Developer Wiki
Jump to: navigation, search

I think the problem is not only limited to the number of digits but to the value itself, too:

If you call setString(...) on a TextField constrained to TextField.Numeric and the numeric value exceeds Integer.MAX_VALUE then an IllegalArgumentException is thrown.


How to reproduce

   TextField textField = new TextField("Enter Number:", "", 10, TextField.NUMERIC);
   long n = Integer.MAX_VALUE;
   textField.setString(Long.toString(n));
   System.out.println("OK for Integer.MAX_VALUE, i.e. " + n);
   try {
       textField.setString(Long.toString(++n));
   }
   catch (IllegalArgumentException e) {
       System.out.println("FAILED for Integer.MAX_VALUE + 1, i.e. " + n);
   }



Thank you for your feedback. The article has been updated.

Forum Nokia KB 14:58, 16 April 2008 (EEST)

 

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×