Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-currency-input

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-currency-input - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

2

package.json
{
"name": "react-currency-input",
"version": "1.0.3",
"version": "1.0.4",
"description": "React component for inputing currency amounts",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -21,12 +21,16 @@ # react-currency-input

const MyApp = React.createClass({
handleChange(newValue){
console.log(newValue)
}
render() {
return (
<div>
<CurrencyInput value="0" onChange={this.handleChange}/>
</div>
);
}
getInitialState(){
return ({amount: "0.00"});
},
handleChange(newValue){
this.setState({amount: newValue});
}
render() {
return (
<div>
<CurrencyInput value={this.state.amount} onChange={this.handleChange}/>
</div>
);
}
}

@@ -44,13 +48,13 @@ export default MyApp

const MyApp = React.createClass({
handleSubmit(event){
event.preventDefault();
console.log(this.refs.myinput.getMaskedValue())
}
render() {
return (
<form onSubmit={this.handleSubmit}>
<CurrencyInput value="0" ref="myinput" />
</form>
);
}
handleSubmit(event){
event.preventDefault();
console.log(this.refs.myinput.getMaskedValue())
}
render() {
return (
<form onSubmit={this.handleSubmit}>
<CurrencyInput ref="myinput" />
</form>
);
}
}

@@ -68,3 +72,3 @@ export default MyApp

// 1.234.567,89
<CurrencyInput decimalSeparator="," thousandSeparator="." value="0" onChange={this.handleChange} />
<CurrencyInput decimalSeparator="," thousandSeparator="." />
```

@@ -75,3 +79,3 @@

// 123,456.789
<CurrencyInput precision="3" value="0" onChange={this.handleChange} />
<CurrencyInput precision="3" />
```

@@ -81,3 +85,3 @@

// 123,456,789
<CurrencyInput precision="0" value="0" onChange={this.handleChange} />
<CurrencyInput precision="0" />
```

@@ -89,3 +93,3 @@

```javascript
<CurrencyInput className="form-control" value="0" onChange={this.handleChange} />
<CurrencyInput className="form-control" />
```

@@ -92,0 +96,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc