# react-shassain-numeric

> A react component for formatted number form fields

Latest version **1.0.2** (published 2020-06-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-shassain-numeric
pnpm add react-shassain-numeric
yarn add react-shassain-numeric
bun add react-shassain-numeric
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2020-06-27 |
| First published | 2020-06-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 32.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Juan Carlos Huallpa |
| Maintainers | shassain |
| Keywords | autonumeric, currency, money, monetary, Euro, Dollar, Pound, number, numeric, format, react, numeric, bolivianos, moneda, shassain |

## Links

- npm: https://www.npmjs.com/package/react-shassain-numeric
- Repository: https://github.com/shassain/ShassainNumeric
- Homepage: https://github.com/shassain/ShassainNumeric#readme
- Issues: https://github.com/shassain/ShassainNumeric/issues
- npm.io page: https://npm.io/package/react-shassain-numeric

## Dependencies (1)

- [autonumeric](https://npm.io/package/autonumeric.md) ^4.4.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2020-06-27
- 1.0.1 — 2020-06-27

## README

# react-shassain-numeric

[![npm](https://img.shields.io/npm/l/react-numeric.svg?style=flat-square)]()
[![npm](https://img.shields.io/npm/v/react-numeric.svg?style=flat-square)](https://www.npmjs.com/package/react-shassain-numeric)


A react component for formatted number form fields
> react-shassain-numeric is a wrapper component for [autonumeric](https://github.com/autoNumeric/autoNumeric).


## Installition

```sh
npm install react-shassain-numeric --save
```

## Usage

```jsx
import ShassainNumeric from 'react-shassain-numeric';

export function USDMoneyInput(props){
  const { value } = props; // number typed
  return (
    <ShassainNumeric
      value={value}
      currencySymbol="$"
      minimumValue="0"
      decimalCharacter="."
      digitGroupSeparator=""
      onChange={(event, value)=>{
        console.log(event.target.value); // '1,234.5 $'
        console.log(value); // 1234.5
      }}
    />
  );
}

// You can use predefinedOptions
import { predefinedOptions } from 'react-shassain-numeric';

export function PossitiveUSDMoneyInput(props){
  const { value } = props; // number typed
  return (
    <ShassainNumeric
      value={value}
      preDefined={predefinedOptions.dollarPos}
      onChange={(e, value)=> this.setState({ value })}
    />
  );
}

// if you want to store value as string typed
export function NumberInput(props){
  const { value } = props; // string typed
  return (
    <ShassainNumeric
      value={value}
      outputFormat="string"
      onChange={(e, value)=> this.setState({ value })}
    />
  );
}
```

---
_Source: https://npm.io/package/react-shassain-numeric · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
