Comments (2)
@sidmitra
In the redux-form onSubmit() handler, you can turn the currency formatted string into a number by removing all undesirable characters:
e.g.
const unformattedAmount = formattedAmount.replace(/[^0-9|.|-]+/g,""); // removes everything besides a digit, a period or a minus
const amountAsNumber = Number(unformattedAmount); // the unformatted string is turned into a number
from react-currency-input.
@sidmitra New with version 1.3.0, instead of using the onChange callback, use onChangeEvent. The signature for the new function looks like onChangeEvent(event, maskedvalue, floatvalue). Hopefully this works for your use case.
from react-currency-input.
Related Issues (20)
- Optional decimal separator? HOT 1
- dont work with hooks HOT 6
- Is this package still being maintained? HOT 2
- Please add minimum and maximum value constraints HOT 1
- Please publish a new version HOT 5
- Vulnerabilities found in project dependencies HOT 8
- ref not working correctly with react-hook-form
- Test framework shouldn't be included as dev dependency HOT 2
- Option to make the field a required field
- Please publish the latest changes on master HOT 1
- React complaining about PascalCase props
- Demo page HOT 2
- Issue adding zero running on iOS 9 with Safari
- auto focus false not working HOT 6
- Precision={0} with suffix=",00" make the value passed on onChangeEvent wrong
- IE browser issue HOT 5
- Allow integer parsing HOT 1
- lacks name attribute for support with redux form
- Warning message - React 16.9.0 HOT 2
- Problems with copy paste values HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-currency-input.