BigDecimal format
In this chapter you will learn:
Remove trailing zeros
BigDecimal stripTrailingZeros()
trailing zeros removed.
import java.math.BigDecimal;
//from j a v a 2s .co m
public class Main {
public static void main(String[] args) {
BigDecimal first = new BigDecimal(100000f);
System.out.println(first.stripTrailingZeros());
}
}
The output:
Next chapter...
What you will learn in the next chapter:
Home » Java Tutorial » BigDecimal BigInteger