Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

currency 1

Status
Not open for further replies.

stallion

Programmer
Feb 22, 2000
14
0
0
GB
how do i make a value in a text box have 2 decimal places so that it looks like a monetary value? ie $12.75 instead of $12.749 an so on<br>
cheers
 
Try something like this:<br>
<br>
<br>
Dim amount As Single<br>
amount = 7.952<br>
Text1.Text = Format(amount, &quot;currency&quot;)<br>
<br>
<br>
<br>
hope this helps<br>
Bob <p>Robert L Norton<br><a href=mailto:2dogs@webace.com.au>2dogs@webace.com.au</a><br><a href= > </a><br>
 
cheers, but how would i make the amount equal the value in a text box?
 
stallion,<br>
<br>
Dim amount As Single<br>
amount = val(me!text1)<br>
Text1.Text = Format(amount, &quot;currency&quot;)<br>
--Jim
 
to jim<br>
my program works absolutely perfectly i can't thank you enough, you are my tipmaster of the week, keep up the good work<br>
cya<br>
nick
 
You could also use <br>
<br>
Dim amount As Single<br>
amount = val(me!text1)<br>
Text1.Text = Format(amount, &quot;$ ###,###,###0.00&quot;)<br>
<br>
This would place the dollar sign, then a space before your ammount.<br>
<br>
The # are used only if there is a nuber to place there.<br>
The 0 are place takers that must be occupied. ie .847 would yield $ 0.85<br>
<br>
I'm not saying this is better, in most cases it is not, it is however more flexible.<br>
<br>
<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top