UNPKG

phpjs

Version:

php.js offers community built php functions in javascript

36 lines (29 loc) 879 B
<!-- Generated by Rakefile:build --> <strong> <a href="http://www.coursesweb.net" rel="nofollow">CoursesWeb</a> </strong> on 2012-04-30 08:40:35 <br /> Hi, For is_float i use this version: <pre><code> function is_float(n) { return n===+n &amp;&amp; n!==(n|0); } </code></pre> - is_float() doesn't always work if you are validating form input. This is because form inputs are strings, even if the user typed a number. <hr /> <strong> <a href="http://www.ita.es" rel="nofollow">Enrique Melendez</a> </strong> on 2011-03-23 11:13:04 <br /> version in one line: <pre><code> return typeof mixed_var == 'number' ? !!(mixed_var % 1) : false; </code></pre> <hr /> <strong> <a href="http://webdevhobo.blogspot.com" rel="nofollow">WebDevHobo</a> </strong> on 2009-12-13 09:24:02 <br /> Nevermind my comments, I just now noticed in the docs the text about the 1.0 issue. :P <hr />