heminfotech Posted December 26, 2006 Share Posted December 26, 2006 I need to validate that the number should be in the format of the 00.00 and not 00.00..........Pls. Any one know regarding JS function that can help me on this.Thanks for all your supportHello friends I want to edit this a bit Pls help me My Criteria for checking the values are it must not be greater than 6 digits including decimal point "xxx.xx" this is ideal format but u can enter values like .00,0.00,00.00 etc I need to check that there must not be more than 2 digits after the decimal point .000 its wrong method how to validate this pls help me on this thanks Quote Link to comment Share on other sites More sharing options...
Submerged Posted December 27, 2006 Share Posted December 27, 2006 If you don't need it chopped off until the next page (if your submitting a form with it), you could use the PHP function "round", which comes with a way to leave a few desired decimals. If you need an immediate change, I'm sure JS can do it, just not good enough with it to know how off the top of my head. Quote Link to comment Share on other sites More sharing options...
fenway Posted December 27, 2006 Share Posted December 27, 2006 You can be lazy and just chop it with substring(), or you can use Math.round(). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.