BigDecimal decimal point
In this chapter you will learn:
Methods to move decimal point
BigDecimal movePointLeft(int n)
decimal point moved n places to the left.BigDecimal movePointRight(int n)
decimal point moved n places to the right.
import java.math.BigDecimal;
/*from j a va2 s. c o m*/
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:
Next chapter...
What you will learn in the next chapter:
Home » Java Tutorial » BigDecimal BigInteger