Judge positive or negative numbers

From , 4 Years ago, written in JavaScript, viewed 51 times.
URL https://pastebin.vip/view/092cb13c
  1. <script type="text/javascript">
  2.   var float_num = -12;
  3.         if (!/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(float_num)) {
  4.                 //非法
  5.                 alert("no");
  6.         }else{
  7.                 //通过
  8.                 alert("ok");
  9.         }
  10.   </script>

Reply to "Judge positive or negative numbers"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website