If you have a number like 137, and you want to know how many digits it is composed:

var number = 137; var nbrOfDigits = Math.Floor(Math.Log10(number) + 1); //nbrOfDigits = 3

If you have a number like 137, and you want to know how many digits it is composed:

var number = 137; var nbrOfDigits = Math.Floor(Math.Log10(number) + 1); //nbrOfDigits = 3

You must be logged in to post a comment.

## No Comments Yet