DoubleRenderer patch

1 view
Skip to first unread message

J Ross Nicoll

unread,
Jun 26, 2008, 12:12:17 PM6/26/08
to jsystemt...@googlegroups.com
Got fed up of DoubleRenderer turning 2.9 into 2.8999, so here's a
patch. Also avoids using BigDecimal as an interim format.

double_renderer.diff

Eugene Kononov

unread,
Jun 26, 2008, 1:01:13 PM6/26/08
to jsystemt...@googlegroups.com
I have not looked at DoubleRenderer in JST a while, but the 4 decimal places after the decimal point may have been intentional to accommodate Forex prices, such as EUR.USD 1.5562, for example. Florent would need to confirm.

In JBT, the precision is passed to the constructor. That way, you can use multiple instances of renderer to make it look right for all cells. See attachment.



NumberRenderer.java

Florent Guiliani

unread,
Jun 26, 2008, 1:08:31 PM6/26/08
to jsystemt...@googlegroups.com
Eugene Kononov wrote:
> I have not looked at DoubleRenderer in JST a while, but the 4 decimal
> places after the decimal point may have been intentional to accommodate
> Forex prices, such as EUR.USD 1.5562, for example. Florent would need to
> confirm.

right.

J Ross Nicoll

unread,
Jun 26, 2008, 2:18:35 PM6/26/08
to jsystemt...@googlegroups.com
Sorry, should have been clearer.

It was rendering 1.9 (entered) as 1.8999, due to the translation of
double to BigDecimal and back again for the rounding. I've changed how
it does the rounding, but not the precision of the rounding, so that
the results should better reflect what was entered.

That make sense?

> <NumberRenderer.java>

Eugene Kononov

unread,
Jun 26, 2008, 2:22:07 PM6/26/08
to jsystemt...@googlegroups.com
I've changed how
it does the rounding, but not the precision of the rounding, so that
the results should better reflect what was entered.

That make sense?


Yes, it does. Thanks again for your contributions, JRN. Hope to see you in the JBookTrader development sometime. Hopefully earlier than 2009 :-).

Florent Guiliani

unread,
Jun 26, 2008, 4:10:26 PM6/26/08
to jsystemt...@googlegroups.com
I cannot apply your patches. Look at the content. It is like:

Index:=20=
source/com/jsystemtrader/platform/optimizer/StrategyOptimizerRunner.java=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A---=20=

I don't know how you got this result. Which tools and command did you use to
generate the patches?

J Ross Nicoll a écrit :


--
Florent,
Listen to my playlist on http://flyerenv.blogspot.com/

J Ross Nicoll

unread,
Jun 26, 2008, 6:20:38 PM6/26/08
to jsystemt...@googlegroups.com
The content encoding has been screwed up somewhere by at least one e-
mail application. Could zip and try again, but probably easier just to
throw them on the web:

http://jrn.me.uk/jsystemtrader/20080625_browser.diff
http://jrn.me.uk/jsystemtrader/20080625_thread.diff
http://jrn.me.uk/jsystemtrader/20080626_double.diff

Do tell me if that works okay now?

Florent Guiliani

unread,
Jun 27, 2008, 4:05:12 AM6/27/08
to jsystemt...@googlegroups.com
Thank you, it's look fine now. I'll try to apply it this week end.

Florent Guiliani

unread,
Jul 2, 2008, 4:33:12 PM7/2/08
to jsystemt...@googlegroups.com
On Friday 27 June 2008 00:20:38 J Ross Nicoll wrote:
> The content encoding has been screwed up somewhere by at least one e-
> mail application. Could zip and try again, but probably easier just to
> throw them on the web:
>
> http://jrn.me.uk/jsystemtrader/20080625_browser.diff
> http://jrn.me.uk/jsystemtrader/20080625_thread.diff
> http://jrn.me.uk/jsystemtrader/20080626_double.diff
>
> Do tell me if that works okay now?

All 3 patches has been applied into the SVN trunk.

Do you use SVN ?

--
Florent,

J Ross Nicoll

unread,
Jul 4, 2008, 2:15:05 PM7/4/08
to jsystemt...@googlegroups.com
Yes, I do. Got it now, looks good, thanks!
Reply all
Reply to author
Forward
0 new messages