Valor = 19.90;
MyArray = valor.split(".");
The code hangs, integer variable, however,
Valor = "19.90";
MyArray = valor.split(".");
alert(MyArray[0]) = 19;
alert(MyArray[1]) = 90;
I would like to know how to use the split int variable, thank you.
According to solutions, from friends already reputed below, I edit my question for the following way.
No, in the case above, I have the function,
function splitNum (34.50 * 2){
var s = n.toFixed(2).split('.');
var n1 = parseInt(s[0], 10); // 19
var n2 = parseInt(s[1], 10); // 10
return n1+"."+n2;
}
will return me 69.0
But I need you to return 69.00, how could that be? Thank you.
Solved, thank you, have a great afternoon.
function splitNum (34.50 * 2){
var s = n.toFixed(2).split('.');
var n1 = parseInt(s[0], 10); // 19
var n2 = parseInt(s[1], 10); // 10
return s[0]"."s[1];
}