Here you can find the source of divide(String num1, String num2)
public static String divide(String num1, String num2)
//package com.java2s; import java.math.BigDecimal; public class Main { public static String divide(String num1, String num2) { BigDecimal n1 = new BigDecimal(num1); BigDecimal n2 = new BigDecimal(num2); return n1.divide(n2, 8, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString(); }/*from www. j a v a 2 s .c om*/ }