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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert integer for decimal 1

Status
Not open for further replies.

snowboardr

Programmer
Joined
Feb 22, 2002
Messages
1,401
Location
PH
I need to know how to convert a decimal to an integer without removing the cents off the price. I am trying to figure out the % of profit, but it removes the .45 off of 345.45 when I add CINT or CLNG to it...

Code:
If frmPrice > 0 AND frmYourPrice > 0 then
						intPercentProfit =  frmPrice / frmYourPrice
						intPercentProfit = intPercentProfit * 100
						intPercentProfit = intPercentProfit  - 100
						intPercentProfit = FormatNumber(intPercentProfit,2) & "% profit"
					End If

www.sitesd.com
ASP WEB DEVELOPMENT
 
Use CSng() or CDbl() for floating point numbers.

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top