How can I add a zero to int or string ?

andyw27
andyw27 used Ask the Experts™
on
Hello,

I read the contents of a textfield into a variable like this:

value01=new Integer(Entry.getText()).intValue();

say the value entered was 200 I need to take that and turn it into 2000.

Any suggestions as to how this might be accomplished?

Thanks.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Try this

value01 *= 10;
simply multiply by 10 will solve it.

Author

Commented:
Thanks for the solution.
Please accept my comment then :)
Or:
String value01=Entry.getText() + "0";

If you want the text of course ........

;JOOP!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial