LoginSignup
23
17

More than 5 years have passed since last update.

Javaで数値の桁数を取得

Last updated at Posted at 2016-09-02

数値の桁数を取得したかったのでメモ。

int val = 100;
int valLen = String.valueOf( val ).length();    // 3が返される
23
17
5

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
23
17