Sunday, January 30, 2022

Calculate length/number of digits in a Number

int n=12345;

int number_of_digits = (int)Math.log10(n)+1;

No comments:

Post a Comment

Popular Posts

Most Featured Post

GitHub: Squash all commits in PR

  Command Meaning git fetch origin Get the latest origin/master . git reset --soft origin/master Move your branch to match origin/master , b...