Array,Split,IndexOf,CharAt,parseInt In Javascript
Below code for Decimal Value Convert to Integer Using JavaScript Split,Array,IndexOf,CharAt
var inst=document.getElementById("txtAmount").value;
if (inst.indexOf(".") != -1 )
{
var temp = new Array();
temp = inst.split(".");
temp = temp[1];
var check = temp.charAt(0);
if(parseInt(check) >= 5)
{
inst = parseInt(inst) + 1;
}
}
No comments:
Post a Comment