PDA

View Full Version : Counting decimals


lildog
11-15-2005, 01:53 PM
I’m not sure if this is even possible but does anyone know how to count how many decimal places were entered when a user submits a value (type = Double).

So in other words if they entered:

12.5 I’m looking to get a count of 1

12 would give a count back of zero

12.001 would give a count of 3

Thanks in advance for any help you can shed.

BaldEagle
11-17-2005, 11:07 PM
// if already a str no need for this
myNumStr = CStr(myNum)

numDecimals = Len(myNumStr) - InStr(1,myNumStr,".")

Baldeagle