Hive
    Preparing search index...

    Function applyRateCeil

    • 通过万分比计算数值,策略是向上取整

      Parameters

      • value: number

        原始数值

      • rate: number

        万分比(0-10000之间的整数)

      Returns number

      计算后的数值

      applyRateCeil(1000, 1000) // 100,等价于百分比运算 1000 * 0.1 = 100
      applyRateCeil(1000, 105) // 11,等价于百分比运算 1000 * 0.0105 = 10.5,向上取整得 11