| Author |
ghost number format exception
|
amrish sharma
Greenhorn
Joined: Sep 24, 2009
Posts: 20
|
|
i am taking value from jlabel for ex its 1000
i want to make substraction operation on it
when i convert into string to int
it gives this error
my code for convertion is this
please reply as soon as possible
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8439
|
|
|
Remove the " from "1000 to fix your problem
|
[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
|
 |
amrish sharma
Greenhorn
Joined: Sep 24, 2009
Posts: 20
|
|
i found the solution
thanks all
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24057
|
|
The correct way to do this is to use a try block and catch the exception if it occurs. You can't trust user input to be in the correct format!
|
[Jess in Action][AskingGoodQuestions]
|
 |
 |
|
|
subject: ghost number format exception
|
|
|