Jump to content

[SOLVED] [Resolved] Hi Friends To Math logic Needed for the javascript


heminfotech

Recommended Posts

[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 10

Thanks 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

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.