1.0.3 • Published 7 months ago

@types/calc-percent v1.0.3

Weekly downloads
4
License
MIT
Repository
github
Last release
7 months ago

Installation

npm install --save @types/calc-percent

Summary

This package contains type definitions for calc-percent (https://github.com/kevva/calc-percent).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/calc-percent.

index.d.ts

// Type definitions for calc-percent 1.0
// Project: https://github.com/kevva/calc-percent
// Definitions by: Piotr Błażejewicz <https://github.com/peterblazejewicz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/**
 * Calculate percentage
 * @param val - Value which should be calculated.
 * @param total - Total that val should be compared against.
 * @param [opts]
 */
declare function calc(val: number, total: number, opts?: calc.Options): string;

declare namespace calc {
    interface Options {
        /**
         * Number of decimals
         * @default 0
         */
        decimal?: number | undefined;
        /**
         * Append a suffix.
         * @default ''
         */
        suffix?: string | undefined;
    }
}

export = calc;

Additional Details

  • Last updated: Thu, 08 Jul 2021 00:35:48 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Piotr Błażejewicz.