Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "math/base/special/ceiln/docs/types/index.d"

Index

Functions

Functions

Export assignment ceiln

  • ceiln(x: number, n: number): number
  • Rounds a numeric value to the nearest multiple of 10^n toward positive infinity.

    Notes

    • When operating on floating-point numbers in bases other than 2, rounding to specified digits can be inexact.

    Parameters

    • x: number

      input value

    • n: number

      integer power of 10

    Returns number

    rounded value

    Example

    // Round a value to 2 decimal places:
    var v = ceiln( 3.141592653589793, -2 );
    // returns 3.15

    Example

    // If n = 0, `ceiln` behaves like `ceil`:
    var v = ceiln( 3.141592653589793, 0 );
    // returns 4.0

    Example

    // Round a value to the nearest thousand:
    var v = ceiln( 12368.0, 3 );
    // returns 13000.0