Description Of BigDecimal: divideToIntegralValue(BigDecimal divisor)
The java.math.BigDecimal.divideToIntegralValue(BigDecimal divisor) returns a BigDecimal whose value is the integer part of the quotient (this / divisor) rounded down. The preferred scale of the result is (this.scale() - divisor.scale())BigDecimal.divideToIntegralValue(BigDecimal divisor) method returns The integer part of this / divisor
Code Example Java BigDecimal
import java.math.BigDecimal; public class BigDecimalExam { public static void main(String[] args) { BigDecimal bg1 = new BigDecimal("1000.12"); BigDecimal bg2 = new BigDecimal("332.32"); BigDecimal bg3 = bg1.divideToIntegralValue(bg2); System.out.println(bg3); } }
ไม่มีความคิดเห็น :
แสดงความคิดเห็น