0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

jsで整数か否かの判別をするメソッド

Posted at

メソッドで整数判別をおこなう

整数と少数の判別をおこない、条件によって表示を変えたいとおもった時、どのように数字の型の判別を行えば良いのか調べた。
numberに該当の数字をいれて、引数が整数ならtrueをそれ以外ならfalseを返す、メソッドが以下。

Number.isInteger ( number )

参考
https://lab.syncer.jp/Web/JavaScript/Reference/Global_Object/Number/isInteger/

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?