Java BigDecimal movePointLeft() methodThe movePointLeft() method of Java BigDecimal class is used to move the decimal point of the current BigDecimal by n places to the left.
The BigDecimal returned by this call has value (this � 10-n) and scale max(this.scale()+n, 0). Syntax:Parameter:n: number of places to move the decimal point to the left. Exception:ArithmeticException- If scale overflows, then it throws exception: Returns:It returns a BigDecimal which is equivalent to this one with the decimal point moved n places to the left. Example 1Test it NowOutput: Final result after 3 move point left =0.12323 Example 2Test it NowOutput: Final result after 4 move point left =5345440.0000 Example 3Test it NowOutput: Final result after -2 move point left =53454400 Example 4Test it NowOutput: Final result after -2 move point left =-553742733.457 Next TopicJava BigDecimal |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India