# @types/parse-decimal-number

> TypeScript definitions for parse-decimal-number

Latest version **1.0.2** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/parse-decimal-number
pnpm add @types/parse-decimal-number
yarn add @types/parse-decimal-number
bun add @types/parse-decimal-number
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2023-11-07 |
| First published | 2023-01-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51419 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/parse-decimal-number
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/parse-decimal-number
- npm.io page: https://npm.io/package/@types/parse-decimal-number

## Recent versions

- 1.0.2 (latest) — 2023-11-07
- 1.0.0 (ts4.2) — 2023-01-05
- 1.0.1 — 2023-10-18

## README

# Installation
> `npm install --save @types/parse-decimal-number`

# Summary
This package contains type definitions for parse-decimal-number (https://github.com/AndreasPizsa/parse-decimal-number).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/parse-decimal-number.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/parse-decimal-number/index.d.ts)
````ts
declare namespace parseDecimalNumber {
    type ArrayOptions = [thousands: string, decimal: string];

    interface HashOptions {
        /**
         * Decimal point character.
         * Default: ".".
         */
        decimal: string;
        /**
         * Thousands separator character.
         * Default: ",".
         */
        thousands: string;
    }

    type Options = ArrayOptions | HashOptions | string;

    /**
     * Has the same effect as `parseDecimalNumber.setOptions({ thousands: ",", decimal: "." })`.
     */
    function factoryReset(): void;
    /**
     * Set the default thousands and decimal characters that are used when no options are passed to
     * {@link parseDecimalNumber}.
     */
    function setOptions(hash: HashOptions): void;
    /**
     * Returns a function that will take a string as an argument and return a float or `NaN`,
     * just like {@link parseDecimalNumber}.
     */
    function withOptions(options: Options, enforceGroupSize?: boolean): (string: string) => number;
}

declare function parseDecimalNumber(
    /**
     * A string that is supposed to contain a number.
     */
    string: string,
    /**
     * A string, array or hash with thousands and decimal separators.
     */
    options?: parseDecimalNumber.Options,
    /**
     * A boolean indicating whether to support that individual groups between the thousands
     * character are exactly 3 digits.
     */
    enforceGroupSize?: boolean,
): number;

export = parseDecimalNumber;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: none

# Credits
These definitions were written by [Ciarán Ingle](https://github.com/ciaran1344).

---
_Source: https://npm.io/package/@types/parse-decimal-number · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
