Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

BigDecimal representation problem  RSS feed

 
Manuel Jordan
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BigDecimal doesn't support fractions, but Apache Commons Math does. Check out the Fractions class.
[ January 13, 2008: Message edited by: Ulf Dittmer ]
 
Manuel Jordan
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf

thanks for the reply

it works

thanks
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!