@types/round
TypeScript icon, indicating that this package has built-in type declarations

2.0.3 • Public • Published

Installation

npm install --save @types/round

Summary

This package contains type definitions for round (https://github.com/bendrucker/round.js#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/round.

index.d.ts

/**
 * Round numbers to the nearest multiple with an optional direction.
 * @param value The value to round.
 * @param multiple The multiple to round to.
 * @param direction If no direction is supplied, the number will be rounded to the nearest direction, defaulting to up if the value is equidistant from the rounded values.
 */
declare function round(value: number, multiple?: number, direction?: round.Direction): number;

declare namespace round {
    type Direction = "up" | "down";

    /**
     * Convenience method for rounding down.
     */
    function down(value: number, multiple?: number): number;

    /**
     * Convenience method for rounding up.
     */
    function up(value: number, multiple?: number): number;
}

export = round;

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

These definitions were written by Rajas Paranjpe.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/round

Weekly Downloads

15

Version

2.0.3

License

MIT

Unpacked Size

4.04 kB

Total Files

5

Last publish

Collaborators

  • types