Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

How I can convert array of objects to the double data type?
 Post subject: How I can convert array of objects to the double data type? Post rating: 0   New post Posted: Tue 14 Jun, 2011, 13:18 
User avatar

User rating: 1
Joined: Tue 14 Jun, 2011, 11:41
Posts: 26
Location: Lithuania, Vilnius
Hi Support,

I call custom indicator from my strategy and print elements.
I want to use the operators “>”, “<” with elements of custom indicator. How I can convert array of objects to the double data type?

Thanks.


 
 Post subject: Re: How I can convert array of objects to the double data ty Post rating: 0   New post Posted: Tue 14 Jun, 2011, 14:07 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Try:
       Object[] objArr = { 90.99, 10.55, 2.33};
       double d ;
       for(int i = 0; i<objArr.length; i++)
          d = Double.valueOf(objArr[i].toString());

If this example does not help you, then please provide a code snippet and explain what are you trying to achieve.


 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com