Help with calculation

Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2004
Posts: 1
Reputation: Edrog is an unknown quantity at this point 
Solved Threads: 0
Edrog Edrog is offline Offline
Newbie Poster

Help with calculation

 
0
  #1
Nov 3rd, 2004
Hi I need alittle help. I am doing a VB.Net class and I am having trouble with code for calculating. I dont know hoe to do the code for it. I have to have a calculation for Original Price, Discount rate and New Price. Plus I dont know how to display dollar signs or two decimal places in the new and discount price amounts. Can someone help me.
Thanks, Ed
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 5
Reputation: slavedogg is an unknown quantity at this point 
Solved Threads: 0
slavedogg's Avatar
slavedogg slavedogg is offline Offline
Newbie Poster

Re: Help with calculation

 
0
  #2
Feb 27th, 2008
To do calculations I would need more info, but to add a $ and two decimal you must format the output.

dim UnitPrice as Double = 9.99
lableTotal.text=String.Format("{0:c}", UnitPrice)

This will display $9.99

Hope this helps...
_______
|} {} gg|
----------
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the VB.NET Forum


Views: 3438 | Replies: 1
Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC