The Java Developers Almanac 1.4


Order this book from Amazon.

   
Home > List of Packages > java.math  [6 examples]

e128. Setting the Decimal Place of a Big Decimal Value

    int decimalPlaces = 2;
    
    // Truncates the big decimal value.
    bd = bd.setScale(decimalPlaces, BigDecimal.ROUND_DOWN);
    String string = bd.toString();

 Related Examples
e126. Operating with Big Integer Values
e127. Operating with Big Decimal Values
e129. Performing Bitwise Operations with BigInteger
e130. Parsing and Formatting a Big Integer into Binary, Octal, and Hexadecimal
e131. Parsing and Formatting a Byte Array into Binary, Octal, and Hexadecimal


© 2002 Addison-Wesley.