Skip to content
This repository has been archived by the owner on May 12, 2019. It is now read-only.

Update Tick.toString method #37

Closed
lequer opened this issue Apr 30, 2015 · 1 comment
Closed

Update Tick.toString method #37

lequer opened this issue Apr 30, 2015 · 1 comment
Labels

Comments

@lequer
Copy link
Contributor

lequer commented Apr 30, 2015

in Tick.toString method, we try to format a Decimal to a Double:

java.util.IllegalFormatConversionException: f != eu.verdelhan.ta4j.Decimal
    at java.util.Formatter$FormatSpecifier.failConversion(Formatter.java:4302)
    at java.util.Formatter$FormatSpecifier.printFloat(Formatter.java:2806)
    at java.util.Formatter$FormatSpecifier.print(Formatter.java:2753)
    at java.util.Formatter.format(Formatter.java:2526)
    at java.util.Formatter.format(Formatter.java:2455)
    at java.lang.String.format(String.java:2925)
    at eu.verdelhan.ta4j.Tick.toString(Tick.java:236)
 @Override
    public String toString() {
        return String.format("[time: %1$td/%1$tm/%1$tY %1$tH:%1$tM:%1$tS, close price: %2$f]", endTime
                .toGregorianCalendar(), closePrice);
    }

Maybe closePrice should be replaced with closePrice.toDouble().
Thanks

@mdeverdelhan
Copy link
Owner

Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants