0.3.0 • Published 2 years ago

use-format-amount-input v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

useFormatAmountInput

Format amount, price, number fields in react

Installation

yarn add use-format-amount-input

or if npm is your thing, do:

npm i use-format-amount-input

Usage

import {useFormatAmountInput} from "use-format-amount-input"

const Component = () => {

    const {amount, handleAmountChange, strippedAmount} = useFormatAmountInput({decimalPlaces: 3, separator:","})

    return <form>
    <input type="text" name="amount" value={amount} onChange={handleAmountChange} />
    <form>
}

Params

You can pass an optional value to useFormatInput() which represents the number of decimal places you want to allow the user to be able to enter

0.3.0

2 years ago

0.2.7

2 years ago

0.2.9

2 years ago

0.2.8

2 years ago

0.2.6

2 years ago

0.2.53

2 years ago

0.2.52

2 years ago

0.2.2

2 years ago

0.2.0

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago