How can I make currency text boxes show 2 decimals

gord9b

Board Regular
Joined
Jun 12, 2002
Messages
247
I am designing an order entry form for customers. I have a textbox for number of items, another textbox as item value and the third textbox as the total item cost. I did a DIM of number of items (amt1) as an Integer and the item value (cost1) and total cost (tcost1) as currency.
When I click on the Calculate button, I want the total costs to show 2 decimals but it keeps dropping trailing blanks, i.e. $2.50 shows as 2.5.
This field is calculated as amt1 * cost1. How can I get these fields (there are many of them) to show the true currency value of2 decimals? Have I defined them incorrectly in the DIM statements?
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
try something like this

TextBox3.Value = Format((TextBox1.Value * TextBox2.Value), "$##,##0.00")
 
Upvote 0

Forum statistics

Threads
1,203,762
Messages
6,057,219
Members
444,915
Latest member
getrdon24

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top