This commit is contained in:
尹吉欢
2017-11-14 09:38:37 +08:00
parent 0ecc9195e5
commit f0db83fac8
4 changed files with 45 additions and 8 deletions
@@ -0,0 +1,26 @@
package com.fangjia.job.common.util;
import java.math.BigDecimal;
public class DataUtil {
public static double getDoubleRound(int scale, double dSource) {
BigDecimal deSource = new BigDecimal(dSource);
return deSource.setScale(scale, BigDecimal.ROUND_HALF_UP).doubleValue();
}
/**
* 求最大公约数
* @param m
* @param n
* @return
*/
public static int divisor(int m,int n) {
if (m % n == 0) {
return n;
} else {
return divisor(n,m % n);
}
}
}