- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
Long newlim = Long.valueOf(scorLim);
BigDecimal newSum = new BigDecimal(newlim.doubleValue());
// округлить сумму
if (reqCurrency.equalsIgnoreCase("RUR")) {
newSum = newSum.setScale(0, BigDecimal.ROUND_HALF_DOWN);
newSum = newSum.divide(new BigDecimal(1000), BigDecimal.ROUND_DOWN).multiply(new BigDecimal(1000));
} else {
newSum = newSum.setScale(0, BigDecimal.ROUND_HALF_DOWN);
newSum = newSum.divide(new BigDecimal(10), BigDecimal.ROUND_DOWN).multiply(new BigDecimal(10));
}
newlim = new Long(newSum.longValue());