|
-
Oct 20th, 2000, 12:19 PM
#1
Thread Starter
Hyperactive Member
if text1.text = 1.22
this would give me the 1
what would i do to get the 22
answer_dollar.caption = Int(text1.text)
-RaY
VB .Net 2010 (Ultimate)
-
Oct 20th, 2000, 12:30 PM
#2
Fanatic Member
Answer_Cents.Caption = Mod(Text1.Text)
-
Oct 20th, 2000, 12:36 PM
#3
Fanatic Member
Urg, I just suffered an ID-10-T error. Try this instead:
Money = 1.22
MsgBox Money
MsgBox Int(Money)
MsgBox (Money - Int(Money)) * 100
If you're always dealing with 2 decimal places. increase or decrease the 100 depending on the number of decimals.
You could always try mid(Text1.Text,InStr(1,Text1.Text,".") as well ...
-
Oct 20th, 2000, 12:37 PM
#4
Fanatic Member
If you're not dealing with 2 decimal places, use this code:
Code:
MsgBox Right(CStr(Text1.Text - Int(Text1.Text)), InStr(1, Text1.Text, "."))
(It also works with 2 decimal places)
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
|