• Post Reply Bookmark Topic Watch Topic
  • New Topic

Instead of RoundingMode.DOWN which class can i use in JDK1.4 version  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to round off 3 decimal value in JDK 1.4 version. Instead of RoundingMode.DOWN which class can i use in JDK1.4 version

Thanks for your reply.

Seems like set scale method in jdk1.4 would not return expected value when we pass BigDecimal argument as a "double" value.To resolve this issue we need to pass a string value



BigDecimal a = new BigDecimal(".77");
BigDecimal b = a.setScale(3, RoundingMode.DOWN);
 
Marshal
Posts: 58470
178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch
Why are you using Java1.4 which was superseded nearly ten years ago?

If you mean the rounding for BigDecimal, have you come across the numeric constants which are described as obsolete? Try them.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!