how to convert double to string in android

i want to convert string in my constructor into double, i can't change it in my constructor, because in one process, the variable must in double, and other class must be string, can you tell me the way to convert it..? this is my constructor :

public class DataItem {
String ijiInvest, ijiId;
String tanggal;
double persenHmint1,inuNilai  selisih,persen_hke1;

public DataItem(String ijiInvest, double persenHmint1, Double inuNilai, 
        double selisih,double persen_hke1, String tanggal,String ijiId) {
    // TODO Auto-generated constructor stub
    this.ijiInvest = ijiInvest;
    this.persenHmint1 = persenHmint1;
    this.inuNilai = inuNilai;
    this.selisih = selisih;
    this.ijiId = ijiId;
    this.tanggal = tanggal;

public String getIjiInvest() {
    return ijiInvest;

public String getIjiId() {
    return ijiId;

public String getTanggal() {

    return tanggal;

public double getPersenHmint1() {
    return persenHmint1;

public Double getInuNilai() {
    return inuNilai;

public double getSelisih() {
    return selisih;

public double persen_hke1(){
    return persen_hke1;

in my base adapter, i want to change getInuNilai() into string this is my base adapter :

public class TabelAdapter extends BaseAdapter{
Context context;
ArrayList<DataItem> listData;//stack
int count;

public TabelAdapter(Context context, ArrayList<DataItem>listData){
public int getCount() {
    // TODO Auto-generated method stub
    return count;

public Object getItem(int arg0) {
    // TODO Auto-generated method stub
    return null;

public long getItemId(int position) {
    // TODO Auto-generated method stub
    return 0;

public View getView(int position, View v, ViewGroup parent) {
    // TODO Auto-generated method stub
    View view= v;
    ViewHolder holder= null;

        LayoutInflater inflater=(LayoutInflater)context.getSystemService(context.LAYOUT_INFLATER_SERVICE);
        view= inflater.inflate(R.layout.main, null);
        holder=new ViewHolder();

    return view;
static class ViewHolder{
    TextView nama, email;

i can't setText getInuNilai() because its return into double, can you tell me how to convert it?


      String yourDoubleString = String.valueOf(yourDouble);

if You want to have the returned double from Your getInuNilai() Method as a String:

first get Your double from this Method:

    double inuNilaiDouble = getInuNilai(); 

and parse it into String:

     String inuNilaiString = String.valueOf(inuNilaiDouble);


     String inuNilaiString = Double.toString(inuNilaiDouble);

if you want this outside Your, make a reference of DataItem and get the double:

    double inuNilaiDouble = mReferenceOfDataItem.getInuNilai(); 

and then parse it into String like shown above.

Need Your Help

How to create an audio streaming site in the style of Lynda or other video-training sites?

wordpress streaming soundcloud shopify audio-player

I would like to make a streaming store like,, or other video-training websites - where the customer can buy and/or subscribe to my digital library, but the customer can only str...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.