Search the web
Sign In
New User? Sign Up
jsci
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
DecimalFormat   Message List  
Reply | Forward Message #305 of 369 |
Re: [jsci] DecimalFormat

Hi,

Thanks for your email. There exists the following methods for changing the
number formatting (defined in Graph2D):

setNumberFormat (all axes)
setXNumberFormat
setYNumberFormat

Regards,

Mark


----- Original Message ----
From: damiaan_persyn <damiaan.persyn@...>
To: jsci@yahoogroups.com
Sent: Friday, 17 November, 2006 5:00:09 PM
Subject: [jsci] DecimalFormat


Hi;

let me first thank you for this great piece of software, I'm enjoing
testing its possibilities and learning some Java in the course.

Being new at Java this question is probably really dumb, but anyway...

I was trying to get two numbers after the decimal point in a
linegraph, in stead of one. (My data consists of stock option prices,
which tick mostly by 0.05 or 0.01 cents, so that's why.)

My approach so far:

1/ unpacked the jsci-xtra.jar file

2/ downloaded Graph2D.java from cvs and changed line 37 to

protected NumberFormat xNumberFormat = new DecimalFormat("##0.00");
in stead of
protected NumberFormat xNumberFormat = new DecimalFormat("##0.0");

3/ made a new classfile running javac Graph2D.java

4/ ran "jar cf jsci-xtra.jar Jsci", copied the new jsci-xtra.jar file
to /usr/share/java (which is in my $CLASSPATH).

5/ recompiled my applet, restarted my browser.

As this all didn't work started deleting stuff from the ~/.java cache,
robooted, did the above for JGraph2D.java as well, changed all
appearances of .0f to .00f... but all to no good.

So am I wrong in how I changed the code, in the recompilation, or is
there maybe some annoying cache issue keeping the old jar's in use?

Btw, why did I had to change line 28 in Graph2D.java to "public" to
get it compile?
(public Graph2D.DataMarker dataMarker = Graph2D.DataMarker.NONE;)

This number formatting seems pretty hard-coded. I guess a
method for setting it would be a nice feature (at least for me :)

Many thanks,

Damiaan





Yahoo! Groups Links



Send instant messages to your online friends http://uk.messenger.yahoo.com



Tue Nov 21, 2006 9:41 pm

mj_hale
Offline Offline
Send Email Send Email

Forward
Message #305 of 369 |
Expand Messages Author Sort by Date

Hi; let me first thank you for this great piece of software, I'm enjoing testing its possibilities and learning some Java in the course. Being new at Java this...
damiaan_persyn
Offline Send Email
Nov 17, 2006
11:14 pm

Hi, Thanks for your email. There exists the following methods for changing the number formatting (defined in Graph2D): setNumberFormat (all axes) ...
Mark Hale
mj_hale
Offline Send Email
Nov 21, 2006
9:48 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help