Move decimal point

ReturnMethodSummary
BigDecimalmovePointLeft(int n)decimal point moved n places to the left.
BigDecimalmovePointRight(int n)decimal point moved n places to the right.

import java.math.BigDecimal;
 

public class Main {
 
    public static void main(String[] args) {
        BigDecimal first = new BigDecimal(10f);
        System.out.println(first);
        System.out.println(first.movePointLeft(1));
    }
}

The output:


10
1.0
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.