Sign in to follow this  
Followers 0
myredeemerlives

GetDigit(Num, Dig) udf

3 posts in this topic

#1 ·  Posted (edited)

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 this post


Link to post
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 this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0