heminfotech Posted December 25, 2006 Share Posted December 25, 2006 [quote]I have to check the value in the textbox. That it must be in increment of 0.10 value so what I used to do is I used to parse it into integer and my logic for it is find th mod of value with 0.10.[code]if(parseInt((document.getElementById("amount").value)) %0.10 != 0){ alert ('must be in 10 cent increments, i.e: $0.10, $0.20, $0.30 etc'); document.getElementById("amount").focus(); document.getElementById("amount").select(); return false; }[/code]but it is not working pls can anyone help me on that[/quote]This issue is resolved Simply multiply the values by 100 & mod by 10Thanks to the moderator for his Support His solution is also correct But I have resolved it in above way U can also use the method of the Moderator Link to comment Share on other sites More sharing options...
fenway Posted December 26, 2006 Share Posted December 26, 2006 Just multiply it by ten and see if it's an integer. Link to comment Share on other sites More sharing options...
Recommended Posts