ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 25th, 2003, 07:53 PM
aaron.martone's Avatar
aaron.martone aaron.martone is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Central Florida
Posts: 76 aaron.martone User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via ICQ to aaron.martone
Unhappy problems with numbers

Ok. Real Quick. What is the best Data Model for the following types of values? (Access 2000)

"Hello" (I'm using Text for this)
"Insert a LOT of information here" (I'm using Memo for this)
0/1 (I'm using Number-Byte for this)
43 (I'm using Number-Long Int for this)
4.23 (I'm using Number-Double for this)

A problem I'm having with my math and ASP/VBscript is this.

What I want to do is take X% off the price of a object. So I do this

price = rsProducts("prodPrice")
' the value of price is 85

percentOff = rsProducts("prodPercentOff")
' the value of percentOff is 10

tmpAmountOff = ((price - 0.00) / 100) * (percentOff - 0)

Sure enough, if I output tmpAmountOff, I get 8. Which is wrong (should be 8.5) So what am I doing here? Wrong datatypes? Wrong math?

I want the final numbers here to be decimal, and rounded at the second decimal place. I SHOULD get 8.5 back. And then I can use

Response.Write("You saved : " & FormatCurrency(tmpAmountOff, 2,-2,-2,-2)

Which should say:

You saved : $8.50

Any help? My thanks in advance!
__________________
aaron martone
professional web developer

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > problems with numbers


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway