I select a number column in database. For example:
BigDecimal total_price_bg;
BigDecimal unit_price_bg;
if (results.next()) {
unit_price_bg = results.getBigDecimal("UNIT_PRICE");
total_price_bg = unit_price_bg.multiply(unit_price_bg); // I have trouble here..
System.out.println(total_price_bg);
}
First row could contain 10.25, second row 7.03 and third row could contain 371.09. How do I multiply big decimal many times with same variable?? Is it actually possible? Thanks in advance.