JavaScript is_real function

A JavaScript equivalent of PHP’s is_real
function is_real (mixed_var) {
  // http://kevin.vanzonneveld.net
  // +   original by: Brett Zamir (http://brett-zamir.me)
  //  -   depends on: is_float
  // %        note 1: 1.0 is simplified to 1 before it can be accessed by the function, this makes
  // %        note 1: it different from the PHP implementation. We can't fix this unfortunately.
  // *     example 1: is_double(186.31);
  // *     returns 1: true
  return this.is_float(mixed_var);
}

Example 1
is_double(186.31);

Should return
true
Теги:
is_real
Добавлено: 27 Июля 2018 22:38:29 Добавил: Андрей Ковальчук Нравится 0
Добавить
Комментарии:
Нету комментариев для вывода...