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 to get rid of E-pow (exponent) in the println function
 Post subject: How to get rid of E-pow (exponent) in the println function Post rating: 0   New post Posted: Thu 11 Feb, 2016, 18:44 
User avatar

User rating: 0
Joined: Fri 13 Mar, 2015, 18:23
Posts: 6
Location: Russian Federation, Moscow
Hello, traders. I faced the problem of viewing the figures of macd indicator in the console.getOut().println function.
It always shows macd figures, for example, in the -1.0E-5 state. What should I do to see them in the decimal format?
Thank you.


 
 Post subject: Re: How to get rid of E-pow (exponent) in the println function Post rating: 0   New post Posted: Fri 12 Feb, 2016, 14:03 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
import java.text.DecimalFormat;

    public String toStr(double d) {
        return (new DecimalFormat("#.#######")).format(d);
    }


 
 Post subject: Re: How to get rid of E-pow (exponent) in the println function Post rating: 0   New post Posted: Fri 12 Feb, 2016, 15:24 
User avatar

User rating: 0
Joined: Fri 13 Mar, 2015, 18:23
Posts: 6
Location: Russian Federation, Moscow
Big thanks, support! )))


 

Jump to:  

cron
  © 1998-2024 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