# Math - Fractions 3/2 to 1 1/2

5 messages
Open this post in threaded view
|

## Math - Fractions 3/2 to 1 1/2

 Hello, Since yesterday I'm using commons-math-2.1.jar to calculate with fractions. It serves my well. There's one last feature I'd like to use, and can not find how. - how do you convert/format fraction 3/2 to 1 1/2 - how do you convert/format fraction 4/2 to 2 Thanks in advance Paul
Open this post in threaded view
|

## Re: Math - Fractions 3/2 to 1 1/2

 On 23 November 2010 13:15, paulbeuk <[hidden email]> wrote: > > Hello, > > Since yesterday I'm using commons-math-2.1.jar to calculate with fractions. > It serves my well. There's one last feature I'd like to use, and can not > find how. > > - how do you convert/format fraction 3/2 to 1 1/2 > - how do you convert/format fraction 4/2 to 2 > See http://commons.apache.org/math/userguide/fraction.html> Thanks in advance > Paul > > -- > View this message in context: http://apache-commons.680414.n4.nabble.com/Math-Fractions-3-2-to-1-1-2-tp3055391p3055391.html> Sent from the Commons - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [hidden email] > For additional commands, e-mail: [hidden email] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email]
Open this post in threaded view
|

## Re: Math - Fractions 3/2 to 1 1/2

 Hello sebb-2-2 > See http://commons.apache.org/math/userguide/fraction.htmlI 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