Skip to main content



NumDigits Function

Returns the number of digits in a given number, not counting trailing zeros to the right of the decimal point nor any leading zeros.

Syntax

NumDigits(value)

Returns the number of digits in a given number, not counting trailing zeros to the right of the decimal point nor any leading zeros.

Arguments

value Numeric - The number whose digits should be counted. Some input numbers will be rounded because the computer cannot store all the places.

Remarks

Example:

NumDigits(0123.4567); // returns 7

Example:

NumDigits(1234567890.1234567890123456789012345); //returns 29 because the input is rounded to 1234567890.1234567890123456789

Example:

NumDigits(0.12345678901234567890123456789012345); //returns 28 because the input is rounded to 0.1234567890123456789012345679

Example:

NumDigits(0.00123000); // returns 3 because neither the leading nor trailing zeros are counted