Results 1 to 1 of 1
- 02-06-2011, 10:29 PM #1
Member
- Join Date
- Feb 2011
- Posts
- 1
- Rep Power
- 0
swt VerifyListener to allow doubles and round to 3 decimal places
Hi,
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.
Similar Threads
-
round to two decimal places
By javaMike in forum New To JavaReplies: 3Last Post: 12-24-2011, 03:01 AM -
3 Decimal Places
By benhawk in forum New To JavaReplies: 7Last Post: 11-02-2010, 10:28 PM -
2 decimal places needed
By lala in forum New To JavaReplies: 5Last Post: 10-27-2010, 09:13 PM -
[SOLVED] Decimal Places - Is this possible?
By dbashby in forum New To JavaReplies: 4Last Post: 04-08-2009, 08:49 PM -
Capping decimal places
By Rageagainst20 in forum New To JavaReplies: 1Last Post: 12-20-2007, 10:28 PM
Bookmarks