How Do I Make The Listbox Display The Figures In Dollar Sign (“c2”) (visual Basics)?

I am practicing For Loops and using a input box. Below is my Code. How do I make the list box display the results in dollar amounts. Here is my code below.
Const rate As Decimal = 0.05D
Dim itemPrice As Decimal
Dim totalPrice As Decimal
Dim count As Single
Dim totalDiscount As Decimal
For count = 1 To 5
itemPrice = CDec(InputBox(“Enter a Price for Item”, “daily discount applied”))
totalDiscount = (itemPrice * rate)
totalPrice = itemPrice – totalDiscount
DiscountListBox.Items.Add(count & ” day ” & totalPrice)
next count
Here is how it comes out (if I were to type in 100s for each 5 entries)
1 day 95
2 day 95
3 day 95
4 day 95
5 day 95
I want it to say
1 day $95.00
2 day $95.00
3 day $95.00
4 day $95.00
5 day $95.00

Both comments and pings are currently closed.

One Response to “How Do I Make The Listbox Display The Figures In Dollar Sign (“c2”) (visual Basics)?”

  1. bady says:

    Dont’t go in deep…
    just add-
    DiscountListBox.Items.Add(count & ” day $” & totalPrice)
    or best way..
    DiscountListBox.Items.Add(count & ” day ” & “$” & totalPrice)

Powered by WordPress | Designed by: free css template | Thanks to hostgator coupon and web hosting reviews