Java BigDecimal movePointRight() methodThe movePointRight() method of java BigDecimal class is used to move the decimal point of the current BigDecimal by n places to the right.
The BigDecimal returned by this call has value (this � 10n) and scale max(this.scale()-n, 0). Syntax:Parameter:n: number of places to move the decimal point to the right. 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 right. Example 1Test it NowOutput: Final result after 3 move point right =123230 Example 2Test it NowOutput: Final result after 4 move point right =5345440000 Example 3Test it NowOutput: Final result after -2 move point right =5345.44 Example 4Test it NowOutput: Final result after -6 move point right =0.0005341254 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