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
Printable View
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
you can use the format function
try
mynum = format(mynumber, "standard")
or
mynum = Format(1E+16, " ###,###,###,###,###,##0")
pete
ahh thanks worked great
ok so far this is what my code looks like
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?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")
VB Code:
strTemp = Format(xxx, "standard") Left$(strTemp, Len(strTemp) - 3)
could ya explaine a little more what i do with this bit of code please
or
mynum = Format(mynum, " ###,###,###,###,###,##0")
edit: if you want decimal to show if there are some use
mynum = Format(mynum, " ###,###,###,###,###,##0.####")
pete
use Clng(
This will take care of any number greater than 0, and still print out a zero.
VB Code:
msgbox Format(text1.text,"#,##0")