标签:ret @param src param string double ble bsp return
1. 获取指定位数小数
/** * 获取指定位数小数 * @param src 源数据 * @param num 指定位数 * @return */ public static double get2decimal(double src, int num) { String fo = "0."; for(int i=0; i<num; i++) { fo+="0"; } DecimalFormat df = new DecimalFormat(fo); return Double.parseDouble(df.format(src)); }
标签:ret @param src param string double ble bsp return
原文地址:https://www.cnblogs.com/redhat0019/p/9144106.html