类 MathUtility
- java.lang.Object
-
- tech.testnx.cah.common.utils.MathUtility
-
public class MathUtility extends Object
- 作者:
- Yun
-
-
字段概要
字段 修饰符和类型 字段 说明 static MathUtilityINSTANCE
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 StringconvertPercentage(double d)Convert a double value to Percentage String, like 85.35%doubleround(double d, int scale)Rounds the given value to the specified number of decimal places f Value to round.floatround(float f, int scale)Rounds the given value to the specified number of decimal places f Value to round.
-
-
-
字段详细资料
-
INSTANCE
public static final MathUtility INSTANCE
-
-
方法详细资料
-
round
public float round(float f, int scale)Rounds the given value to the specified number of decimal places f Value to round. scale Number of digits to the right of the decimal point. For example round(4.567, 2) will be 4.57
-
round
public double round(double d, int scale)Rounds the given value to the specified number of decimal places f Value to round. scale Number of digits to the right of the decimal point. For example round(4.567, 2) will be 4.57
-
convertPercentage
public String convertPercentage(double d)
Convert a double value to Percentage String, like 85.35%
-
-