Results 1 to 1 of 1
- 02-06-2011, 09:29 PM #1Member
- Join Date
- Feb 2011
- Rep Power
swt VerifyListener to allow doubles and round to 3 decimal places
I have been trying to write a verifylistener for a swt text object that:
1. Allows "NaN" or "Infinity" or "" or a double (decimal)
2. If the decimal has more than 3 decimal places I need it to round and replace the fields contents to 3 decimal places.
3. It will also need to allow ints as a user will have to type an integer before a decimal point e.g. "32"
4. It will need to allow ints followed by a decimal (and no decimal value) e.g. "32."
I have tried so many things and I just can't seem to get what should be easy to work.
Any suggestions would be greatly appreciated.
- By javaMike in forum New To JavaReplies: 3Last Post: 12-24-2011, 02:01 AM
- By benhawk in forum New To JavaReplies: 7Last Post: 11-02-2010, 09:28 PM
- By lala in forum New To JavaReplies: 5Last Post: 10-27-2010, 08:13 PM
- By dbashby in forum New To JavaReplies: 4Last Post: 04-08-2009, 07:49 PM
- By Rageagainst20 in forum New To JavaReplies: 1Last Post: 12-20-2007, 09:28 PM