# GetDigit(Num, Dig) udf

## Recommended Posts

I ain't got nuttin betta ta do, so I just made this peice a crap here:

It retrieves the digit of a numby poo, in a non-string like manner.

```func GetDigit(\$num, \$dig)

\$numpy = \$num

for \$i = 1 to \$dig
\$mumpy = mod(\$numpy, 10)
\$numpy = int(\$numpy / 10)

next

return \$mumpy[/indent]

endfunc

func DigitCount(\$num)

return int(log(\$num)) + 1

endfunc```

I didn't test it so I don't know if it works or not, you check. I wrote this write into here off the top of my slow brain.

I am pretty sure it works, because well, I wrote it.

Edit: Another thing, it counts from the right. So 1 is the first digit on the right. 2 is the seccond digit from the right.

Forgive me of mistakes however, I haven't used AutoIt in awhile. I been to wrapped up in C++.

Edited by myredeemerlives

##### Share on other sites

I ain't got nuttin betta ta do, so I just made this peice a crap here:

It retrieves the digit of a numby poo, in a non-string like manner.

```func GetDigit(\$num, \$dig)

\$numpy = \$num

for \$i = 1 to \$dig
\$mumpy = mod(\$numpy, 10)
\$numpy = int(\$numpy / 10)

next

return \$mumpy[/indent]

endfunc

func DigitCount(\$num)

return int(log(\$num)) + 1

endfunc```

I didn't test it so I don't know if it works or not, you check. I wrote this write into here off the top of my slow brain.

I am pretty sure it works, because well, I wrote it.

Edit: Another thing, it counts from the right. So 1 is the first digit on the right. 2 is the seccond digit from the right.

Forgive me of mistakes however, I haven't used AutoIt in awhile. I been to wrapped up in C++.

Its the best code ever right?

##### Share on other sites

It got lumpy at this line, so I put a crumpy( before the part that was bumpy, and then it was all humpy dory...

`return \$mumpy;[/indent]`
Edited by jefhal

...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format

## Create an account

Register a new account

• ### Recently Browsing   0 members

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...