LoginSignup
0
0

More than 3 years have passed since last update.

【JSメモ】parseInt()関数 parseFloat()関数 文字列を数値に変換

Last updated at Posted at 2019-05-20

概要

  • parseInt()関数
    文字列を指定の基数で解釈し10進数の整数へ変換する

  • parseFloat()関数
    文字列を浮動小数点の数値に変換

使用方法

parseInt(文字列,基数)
parseFloat(文字列)

使用例

>parseInt('123',10);
123

>parseInt('123',8);
83

>parseInt('123',16);
291

>parseFloat('12.3');
12.3
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