Skip to content

Instantly share code, notes, and snippets.

@kaizawa
Created September 7, 2013 13:26
Show Gist options
  • Save kaizawa/6475542 to your computer and use it in GitHub Desktop.
Save kaizawa/6475542 to your computer and use it in GitHub Desktop.
Method to get digit of given number
private int getDigit (int num)
{
Double d = Math.floor(Math.log10(num));
int i = d.intValue() + 1;
return i;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment