static BigDecimal valueOf(double val)
Translates a double into a BigDecimal.
static BigDecimal valueOf(long val)
Translates a long value into a BigDecimal with a scale of zero.
static BigDecimal valueOf(long unscaledVal, int scale)
Translates a long unscaled value and an int scale into a BigDecimal.
import java.math.BigDecimal;
public class Main {
public static void main(String[] args) {
System.out.println(BigDecimal.valueOf(1.00001));
}
}
The output:
1.00001