This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes BigDecimal representation problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "BigDecimal representation problem" Watch "BigDecimal representation problem" New topic
Author

BigDecimal representation problem

Manuel Jordan
Ranch Hand

Joined: Sep 29, 2006
Posts: 131
Hello guys

i work with BigDecimal like 0.5 or other ugly numbers
my problem is how represent this number to format string 1/2 ?

i saw the api but nothing to help me,

thanks in advanced


kill your pride, share your knowledge with all
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41052
    
  43
BigDecimal doesn't support fractions, but Apache Commons Math does. Check out the Fractions class.
[ January 13, 2008: Message edited by: Ulf Dittmer ]

Ping & DNS - my free Android networking tools app
Manuel Jordan
Ranch Hand

Joined: Sep 29, 2006
Posts: 131
Hi Ulf

thanks for the reply

it works

thanks
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: BigDecimal representation problem
 
Similar Threads
Problem in using BigDecimal values in for Loop
double or BigDecimal
BigDecimal usage
Percision problems with Double and Float numbers
data type for large decimals