Class AmountUtil

java.lang.Object
com.luna.common.math.AmountUtil

public class AmountUtil extends Object
Author:
Luna@win10
  • Field Details

  • Constructor Details

    • AmountUtil

      public AmountUtil()
  • Method Details

    • changeF2Y

      public static String changeF2Y(Long amount)
      将分为单位的转换为元并返回金额格式的字符串 (除100)
      Parameters:
      amount - 分
      Returns:
      Throws:
      Exception
    • changeF2Y

      public static String changeF2Y(String amount) throws Exception
      将分为单位的转换为元 (除100)
      Parameters:
      amount - 分
      Returns:
      Throws:
      Exception
    • changeY2F

      public static String changeY2F(Long amount)
      将元为单位的转换为分 (乘100)
      Parameters:
      amount - 元
      Returns:
    • changeY2F

      public static String changeY2F(String amount)
      将元为单位的转换为分 替换小数点,支持以逗号区分的金额
      Parameters:
      amount - 元
      Returns: