File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes conversion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "conversion" Watch "conversion" New topic


mer imperio

Joined: Aug 11, 2004
Posts: 1
Anybody from the group who can give help. I am using java applets. I want to convert the long or double data type to its string equivalent so that I can display it in textbox. What will i do? What is the code? Pls. help me... Thnks in advanced
Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1211

Have a look at the javadocs for valueOf(..) methods in String class (java.lang) package
Java docs

The future is here. It's just not evenly distributed yet. - William Gibson
Sonny Gill LinkedIn
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

I am going to move this to the more appropriate Java In General (Beginner) forum.

This forum is for Servlets questions.


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
Shashank Agarwal
Ranch Hand

Joined: May 20, 2004
Posts: 105
Here's the code to convert a double into its string equivalent -

Double d = 123;
String s = Double.toString(d);

You may also set the text in the textbox directly


Cool, huh!!!
I agree. Here's the link:
subject: conversion
It's not a secret anymore!