Java tutorial
import java.math.BigDecimal; public class Main { public static void main(String[] args) { Long l = new Long("12345678"); // assign the bigdecimal value of l to bg scale is 4 BigDecimal bg = BigDecimal.valueOf(l, 4); System.out.println(bg); } }