These ideas might provide a hint:
divide(BigDecimal val, int roundingMode)
Returns a BigDecimal whose value is (this / val), and whose scale is this.scale().
public static final int ROUND_DOWNRounding mode to round towards zero. Never increments the digit prior to a discarded fraction (i.e., truncates). Note that this rounding mode never increases the magnitude of the calculated value.
public static final int ROUND_FLOORRounding mode to round towards negative infinity. If the BigDecimal is positive, behave as for ROUND_DOWN; if negative, behave as for ROUND_UP. Note that this rounding mode never increases the calculated value.
Or cast to character string and then delete end characters:
// Delete characters
b.delete(16, 18); // Delete a range: "Now is the time"
b.deleteCharAt(2); // Delete 2nd character: "No is the time"
Edited by Roger F. Gay, 27 March 2007 - 07:32 AM.