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.

Error using DecimalFormat?
 Post subject: Error using DecimalFormat? Post rating: 0   New post Posted: Wed 17 Nov, 2010, 10:44 

User rating: 0
Joined: Thu 27 Aug, 2009, 12:09
Posts: 23
Ok, I'm not a Java expert yet but from looking at examples I still can't see what's wrong with this:

double dOpen;
DecimalFormat fmt = new DecimalFormat("0.00000");
...
print(gsName+": Order ("+sLabel+") opened at "+fmt.Format(dOpen));

I get this compile error: "The method Format(double) is undefined for the type DecimalFormat"???

Any ideas?

Thanks
Mark


 
 Post subject: Re: Error using DecimalFormat? Post rating: 0   New post Posted: Wed 17 Nov, 2010, 10:48 

User rating: 0
Joined: Wed 18 May, 2011, 11:25
Posts: 60
Location: DE
i think you should write fmt.format(dOpen) and not fmt.Format(dOpen). if you use an ide
like eclipse or netbeans, you can use autocomplete and you will not make these errors ;-)


 
 Post subject: Re: Error using DecimalFormat? Post rating: 0   New post Posted: Wed 17 Nov, 2010, 10:58 

User rating: 0
Joined: Thu 27 Aug, 2009, 12:09
Posts: 23
doh! Thanks Tom! Staring me in the face! :roll:

You're right. I should be using a proper ide. It would help that I don't have to keep looking up what methods/properties are available.

Mark


 

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