类 MathUtility


  • public class MathUtility
    extends Object
    作者:
    Yun
    • 字段详细资料

    • 方法详细资料

      • 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%