commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulbeuk <paul.van.beuker...@gmail.com>
Subject Re: Math - Fractions 3/2 to 1 1/2
Date Tue, 23 Nov 2010 13:42:37 GMT

Hello sebb-2-2

> See http://commons.apache.org/math/userguide/fraction.html

I have red that page, but can not find the answer to my question there. Can
you be more specific?

FractionFormat format = new FractionFormat();
Fraction f = new Fraction(4, 2);
String s = format.format(f); 
I want the outcome is human readable as possible, so 2 and not "4 / 2"


Fraction f = new Fraction(3, 2); 
should give me 1 1/2 and not "3 / 2"

tia
-- 
View this message in context: http://apache-commons.680414.n4.nabble.com/Math-Fractions-3-2-to-1-1-2-tp3055391p3055433.html
Sent from the Commons - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message