It's a very weird thing to test out today. parseint (1.13*100), the actual return value is 112. Just look at the code.
Copy Code code as follows:
<script type= "Text/javascript" >
function Test () {
var thisvalue = 0;
Thisvalue=yuantofen ($ ("#inp"). Val ());
alert (Thisvalue);
}
/* Meta-* *
function Yuantofen (yuan) {
return parseint (yuan*100,10);//Workaround: Change this here to: parseint (yuan*1000,10)/10;
}
</script>
<body>
<div>
<input type= "text" id= "INP" name= "pl" value= "1.14"/><!--when the input values are: 1.13, 1.14, 1.15, 1.16, this bug appears. No other data is currently found to have this bug-->
<input type= "button" Name= "OK" value= "confirms" onclick= "test ();" />
</div>
</body>
When you execute the above code, you will find that when you enter a number for the period of 1.13-1.16, such as entering a 1.13, but the value of alert is 1.12, the same, the input is 1.16 alert out of 1.15.
But that doesn't happen when you enter 2.13, 3.13, 0.13.
This bug is especially important for the most business accounts.
For example: you want to send money to So-and-so, remittance unit is (billion), your remittance 113 million, the result actually became 112 million. Ha ha. A joke. But the program is fastidious rigorous, no matter is a penny or 0.01 cents is who's who, must not be sloppy.