|
-
Jan 5th, 2002, 04:11 PM
#1
Thread Starter
Lively Member
Selecting all numbers after decimal point
how would I do this?
Shak
-
Jan 5th, 2002, 04:38 PM
#2
Hyperactive Member
VB Code:
Number = 45.235
strnumber = CStr(Number)
pos = InStr(strnumber, ".")
decimals = Right(strnumber, Len(strnumber) - pos)
If your PC has , as decimal separator (european settings) then put "," instead "." inside InStr
-
Jan 5th, 2002, 04:51 PM
#3
Thread Starter
Lively Member
thanks
-
Jan 5th, 2002, 05:11 PM
#4
Addicted Member
-
Jan 5th, 2002, 07:00 PM
#5
Frenzied Member
Originally posted by Everso
or y=x-int(x)
RobShakir, this is probably a better option because it will be faster becase there are no strings involved. however there are few situation where it will matter. It is only important in loops. Just thought i'd let you know.
You just proved that sig advertisements work.
-
Jan 5th, 2002, 07:07 PM
#6
Thread Starter
Lively Member
thanks 
I have it now 
Shak
-
Jan 5th, 2002, 07:07 PM
#7
Hyperactive Member
Originally posted by Everso
or y=x-int(x)
Both codes are for a different purpose
Using Int
x=43.235
y=0.235
Using strings
x=43.235
y=235
Only one code works depending on what is required
-
Jan 5th, 2002, 07:29 PM
#8
Frenzied Member
Originally posted by joijo
Both codes are for a different purpose
Using Int
x=43.235
y=0.235
Using strings
x=43.235
y=235
Only one code works depending on what is required
good point...
You just proved that sig advertisements work.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|