mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-18 20:21:35 +00:00
Fix unhandled premium input with too many decimal digits
This commit is contained in:
parent
e0d4b4f7d1
commit
7b75973eba
@ -199,6 +199,7 @@ class MakerPage extends Component {
|
|||||||
const { t } = this.props;
|
const { t } = this.props;
|
||||||
var max = 999;
|
var max = 999;
|
||||||
var min = -100;
|
var min = -100;
|
||||||
|
var premium = e.target.value
|
||||||
if(e.target.value > 999){
|
if(e.target.value > 999){
|
||||||
var bad_premium = t("Must be less than {{max}}%", {max:max})
|
var bad_premium = t("Must be less than {{max}}%", {max:max})
|
||||||
}
|
}
|
||||||
@ -206,8 +207,13 @@ class MakerPage extends Component {
|
|||||||
var bad_premium = t("Must be more than {{min}}%", {min:min})
|
var bad_premium = t("Must be more than {{min}}%", {min:min})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (premium == ""){
|
||||||
|
premium = 0
|
||||||
|
} else {
|
||||||
|
premium = Number(Math.round(premium +"e"+ 2) + "e-" + 2)
|
||||||
|
}
|
||||||
this.setState({
|
this.setState({
|
||||||
premium: e.target.value,
|
premium: premium,
|
||||||
badPremium: bad_premium,
|
badPremium: bad_premium,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user