npm.io
2.5.5 • Published 2 years ago

@types/money-math

Licence
MIT
Version
2.5.5
Deps
0
Size
5 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/money-math

Summary

This package contains type definitions for money-math (https://github.com/ikr/money-math#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/money-math.

index.d.ts

export as namespace Money;

export function add(a: string, b: string): string;
export function amountToCents(value: string): string;
export function centsToAmount(value: string): string;
export function centsToAmount(): undefined;
export function subtract(a: string, b: string): string;
export function mul(a: string, b: string): string;
export function div(a: string, b: string): string;
export function percent(a: string, b: string): string;
export function cmp(a: string, b: string): 0 | number;
export function integralPart(value: string): string;
export function isEqual(a: string, b: string): boolean;
export function isZero(value: string): boolean;
export function isNegative(value: string): boolean;
export function isPositive(value: string): boolean;
export function floatToAmount(value: number): string;
export function format(
    currency: "CHF" | "CNY" | "EUR" | "GBP" | "JPY" | "LTL" | "PLN" | "SEK" | "SKK" | "UAH" | "USD" | string,
    value: string,
): string;
export function roundUpTo5Cents(value: string): string;
export function roundTo5Cents(value: string): string;

Additional Details

  • Last updated: Tue, 07 Nov 2023 0939 GMT
  • Dependencies: none

Credits

These definitions were written by taoqf.