|
-
Jun 11th, 2005, 08:35 AM
#1
Thread Starter
Member
help me :)
im tryin to make a calculator like program i figgured everything out but i wanna no how to put ,'s every three numbers of the results ie instead of it comming back as 1000000000 it goes 1,000,000,000 help would be apreciated
-
Jun 11th, 2005, 08:46 AM
#2
Re: help me :)
you can use the format function
try
mynum = format(mynumber, "standard")
or
mynum = Format(1E+16, " ###,###,###,###,###,##0")
pete
-
Jun 11th, 2005, 09:55 AM
#3
Thread Starter
Member
-
Jun 12th, 2005, 01:33 AM
#4
Thread Starter
Member
Re: help me :)
ok so far this is what my code looks like
Code:
dsummer.Text = (tree.Text * 2.52) + (bush.Text * 8.07) + (flower.Text * 48.08) + (grass.Text * 80.64)
nsummer.Text = (tree.Text * 43.2) + (bush.Text * 138.24) + (flower.Text * 833.28) + (grass.Text * 1382.4)
dspring.Text = (tree.Text * 2.52) + (bush.Text * 8.07) + (flower.Text * 31.36) + (grass.Text * 123.27)
nspring.Text = (tree.Text * 43.2) + (bush.Text * 138.24) + (flower.Text * 537.6) + (grass.Text * 2177.28)
daut.Text = (tree.Text * 4.86) + (bush.Text * 8.07) + (flower.Text * 31.36) + (grass.Text * 80.64)
naut.Text = (tree.Text * 90) + (bush.Text * 138.24) + (flower.Text * 537.6) + (grass.Text * 1382.4)
Dwinter.Text = (tree.Text * 4.86) + (bush.Text * 8.07) + (flower.Text * 31.36) + (grass.Text * 80.64)
Nwinter.Text = (tree.Text * 90) + (bush.Text * 138.24) + (flower.Text * 537.6) + (grass.Text * 1382.4)
dsummer.Text = Format(dsummer.Text, "standard")
nsummer.Text = Format(nsummer.Text, "standard")
dspring.Text = Format(dspring.Text, "standard")
nspring.Text = Format(nspring.Text, "standard")
daut.Text = Format(daut.Text, "standard")
naut.Text = Format(naut.Text, "standard")
Dwinter.Text = Format(Dwinter.Text, "standard")
Nwinter.Text = Format(Nwinter.Text, "standard")
now right now it will return sumthin like this1,000,000.00 i want to get rid of the .00 part how do i do this?
-
Jun 12th, 2005, 01:51 AM
#5
Re: help me :)
VB Code:
strTemp = Format(xxx, "standard")
Left$(strTemp, Len(strTemp) - 3)
-
Jun 12th, 2005, 02:00 AM
#6
Thread Starter
Member
Re: help me :)
could ya explaine a little more what i do with this bit of code please
-
Jun 12th, 2005, 02:01 AM
#7
Re: help me :)
or
mynum = Format(mynum, " ###,###,###,###,###,##0")
edit: if you want decimal to show if there are some use
mynum = Format(mynum, " ###,###,###,###,###,##0.####")
pete
Last edited by westconn1; Jun 12th, 2005 at 02:06 AM.
-
Jun 12th, 2005, 02:02 AM
#8
-
Jun 12th, 2005, 02:04 AM
#9
Re: help me :)
This will take care of any number greater than 0, and still print out a zero.
VB Code:
msgbox Format(text1.text,"#,##0")
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
|