Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This function calculates the length of a number:
Function NLength(ByVal MyNum As Double) As Integer Select Case Sgn(MyNum) Case Is = 1 NLength = 1 + Int(Log(MyNum) / Log(10)) Case Is = 0 NLength = 1 Case Is = -1 NLength = 2 + Int(Log(Abs(MyNum)) / Log(10)) End Select End Function HOWEVER, this omits the fractional part: if you know the precision to which you want to show the number, add 1 + the number of digits after the decimal point to the result. "SHIRA" wrote: i need a function or a macro that calculates the count of digits in a number |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Count number of digits in a cell | Excel Worksheet Functions | |||
VBA write macro change column with 3 number digits to 4 digits the | Excel Discussion (Misc queries) | |||
number 12 digits to 15 digits | Excel Discussion (Misc queries) | |||
Count number of digits (Numbers) | Excel Discussion (Misc queries) | |||
How to customize number to 10 digits including 2 digits after deci | Excel Worksheet Functions |