Calculate Percentage

Our store software currently displays the total amount saved (the list price minus our price) for every product using the code below:

'Calculate "YouSave"
If Product_ListPrice > 0 Then
Product_YouSave = Product_ListPrice - Product_LowestPrice
End If

I, however, would like to also diplay the percentage saved next to the amount saved. I tried using the code below but it won't work. Can someone help me out?

'Calculate "YouSavePercent"
If Product_ListPrice > 0 Then
Product_YouSavePercent = ((1 - (Product_LowestPrice / Product_ListPrice) * 100)
End If

View Replies


ADVERTISEMENT

Calculate A Percentage For Pricing

Well my goal is simple. On my site we show "You save: $**.**" but I want that to say "You save: $**.** (**%)."

The database for our store stores the list price, and our price. The store calculates the you save price... so it should be easy to calculate the saved percentage as well. Here's the code that calculates up the "You save" currently on our website: Code:

View Replies View Related

Getting Percentage

I wrote a survey script but I had problem with the percentage.If 5 persons answers to a question YES and 3 answered NO, how can I get the percentage of each answer (YES & NO)?

View Replies View Related

Value Percentage

this is what im doing

itotalprice = (setfares and other items)

im now dealing with the 5% service charge for credit card payments.

the service charge will be 5% of itotalprice

how can i calculate that.. it will be something like..

surcharge = 5% of itotalprice

fullprice = (itotalprice + surcharge)

View Replies View Related

Get Correct Percentage

I've always been looking for the best way to get an accurate percentage
statistics.

For example, in a election scenario:

Person A gets 33 votes
Person B gets 33 votes
Person C gets 34 votes
Person D gets 35 votes

Total votes = 33 + 33 + 34 + 35 = 135
Percent for A = 0.244.... = 0.24 = 24%
Percent for B = 0.244... = 0.24 = 24%
Percent for C = 0.251... = 0.25 = 25%
Percent for D = 0.259... = 0.26 = 26%

Then add up the percentage values: 24 + 24 + 25 + 26 = 99
(where it should be 100)

So, does anybody have a way to get around this problem? How should I
calculate the percentage for each person so that the percentage will add up
to 100 in the end?

View Replies View Related

Subtract Percentage

I would like to subtract a fixed percentage (15%) but can't seem to get the syntax right.

Output:
Item: Nougat Retail Price: $3.99 Discount Price: 15% Total: ?

Code:
strChocoItem1 = "Nougat"
strRetPrice1 = FormatCurrency("3.99")
strDiscPrice = FormatPercent(".15")
strTotal = ?

I've tried lots of different ways to reach the total but failed every time. I want to subtract the retail price from the discount price using a fixed percentage. Is this possible?

View Replies View Related

Formatting Percentage?

I have a recordset iterating through and dumping out to the screen a series
of percentages, using the precision 5 and numericscale 2 etc.

When I dump them to the page some of the number are missing a trailing
zero - ie, 4.7

What I would very much like to do is add this back on - is there an easy way
to format this with a huge load of If...Then's to produce the same affect?

View Replies View Related

Escaping Percentage

I'm using asp to write an asp page, but I'm having a problem when it comes to closing the written asp script

<%
countFileOpen.write("<% aspCount=5 %>")
%>
how do I escape this character?

View Replies View Related

Simple Percentage Scrip

I need to build a script where in the source code i enter a number and when the page is executed it shows a percentage.

Here is an example of what i'm trying to do

88.83 / 12 = 740%

and the 740% is the only visable thing on the page

View Replies View Related

Percentage Calculation Formula

I have to calculate the percentage of an X amount depending on the Quarter of the year. It's driving me crazy, I can't figure out how to do it. Am I missing something. If someone registers the 1st quarter then the price is the full 1200. f the registration occurs the 2nd Quarter, then it is 25% less that rthe full amount. The 3rd is 50% less and the 4th is 75% less.

the amount is 1200
the Quarters of the year = 4
The regristrant is 1

(1200/4)*100 ?????

View Replies View Related

Percentage On Search Result

i'm sure there're no post about this in asp forum.Any idea how do I show the percentage number for the matching result.

example :

Your search for xxxx :

1. item 1 98%
2. item 2 86%
3. item 3 75%

View Replies View Related

Converting Number To Percentage Function

I want to convert a number to percentage, is there any built-in function for this?

View Replies View Related

Calculate Max Value Of Y Axis

I am using a javascript function to draw a graph on my page, which all works fine. One of the parameters that I pass to the javascript function is the maximum value of the x and y axes.

I have encountered a problem, in that if I hardcode the maximum value of the y axis to 1000, and the maximum value that I am plotting is very low, eg 10, the bar is so small it can hardly be seen. It would be better in this case if the maximum y value was something like 15 to ensure that the bar went almost to the top of the grid.

The code which is doing the count is a simple loop which is looping through each of the months in the financial year counting the number of meetins which have occured in each month. Code:

View Replies View Related

Automatically Calculate

I am building a database that users will update.
I have a table named "products".
Every product has a shelf life of 3 years and expires exactely at the end of the 3rd year.
Here is my table:
Productid ---- int
productName ---- varchar
manufacture_date ----- datetime default (getdate)
Expire_date ----- datetime

What I want is this, whenever a product is entered, the defualt date is the date the entry
was made. (I am using the "getdate") to automatically grab this.
BUT I also want the "Expire_date" field automatically calculated and then filled in.
That is, a user enters a product "manufacture_date" as 05/22/2003,
Then I want the expire field to be filled with 05/22/2006.
My preference is to handle this on the DB site and not ASP.

View Replies View Related

Calculate Values

How to take values from a query and add them together to get totals.The current setup I have:

User selects home they want and clicks on link that passes variable (model home #) that takes them to page 2.

Value in query string is taken and used to bring information about home such as base price amongst other things.

What I would like to do is start with home base price and then call upon options stored in database(each option has their own price)and user can go down a list and select the options(via checkboxes)they want and then at bottom they have a total button that totals base price of home and each option they chose.

View Replies View Related

Calculate From Querystring

if it's possible to do what follows:

i'm getting from querystring *, /, - or + like ...&calculate=* now i want to use this in the calculation like var1 calculate var2 . how do i get it to understand that it's not a string but an actual calculation?

View Replies View Related

How To Calculate With Criterias In ASP?

I have a table named tblsheets (access 2000), There are 4 fields I'm concerned about.
Size, Material Grade, Module and Weight.

I wanted to be able to give the user the ability to calculate the
sum of weight according to a specific material grade and specific size in a specific module.

How would I go about creating an asp script that will allow me to do so?
There has to be an option in which the user can select from a combo box the module, and then select material grade and size, also from a combobox if possible (getting the data from tblsheets).

View Replies View Related

Calculate Day Difference For ASP

I have a problem to calculate the day different. I use

datediff(currentdate, quoteDate) > 20

The error message is : Wrong number of arguments or invalid property
assignment: 'datediff'

I use datediff("D", Date, quoteDate) > 20, but still could get the correct one. Maybe I need to change string to the digit. How to do it?

View Replies View Related

Calculate Form

need to do a simple form calculation in asp based on values in 2 other field and enter that data into table.

(field)SubTotal + (field)VAT = (Result in field)GrandTotal

View Replies View Related

Calculate Tariffs

I have been asked to create an ASP page that calculates a variety of tariffs,i currently have a an excel document which allows users to input the data and then when pressing the auto sum the other spreadsheets update.

Is there away of linking an asp page to the excel document to input the user data, and then to display the results on the next page?

View Replies View Related

Calculate Friday Dates Only

I need to display 3 fields with future dates (Fridays only) as table
column headers.
i.e. 16th Feb | 23rd Feb | 2nd March.

As each week passes, i.e. from the Saturday, the dates should move
accross 1, i.e. column 1 will update to 23rd Feb, Column 2 to 2nd
March and Column 3 to 9th March.

23rd Feb | 2nd March. | 9th March

I need this to work in IE & Firefox specifically.

Please can you help me work this out ?

View Replies View Related

Calculate The Differnce Between Two Times

I am trying to calculate (in minutes) the difference between two times. In the database the times are in this format:

Start Time (Game_Time): 1/1/1900 12:00:00 PM

End Time (GameEndTime): 1/1/1900 1:00:00 PM

Here is the code I'm trying:

Code:

GameLength = DateDiff("n",Game_Time,GameEndTime)

The result is: 780

I would expect it to be: 60 minutes

What am I doing wrong?

View Replies View Related

Calculate Image Dimensions

Is there a simple function in ASP to calculate the dimensions of an image?

View Replies View Related

Calculate All Amount Of A Field.

I want to calculate the sum of all invoices so to be displayed total sum of them
I'm trying with this: Code:

View Replies View Related

Calculate An Interest Rate

I this problem is serious for me because my job depends of it. Maybe my problem is so obvius and easy to solve but I don't know what is the problem. I need to do a program that will calculate an interest rate done it in ASP. It should be made as a page that will have an action in the same page. The rate percent is given into the database and i can not take it from there in order to calculate and display the result. Here is my code: ....

View Replies View Related

Calculate Total Number

i am developing a hosting directory web site on this site there will be the links of hosting websites, i want that when user click on a particular website link it will be recorded in the database how it could be done.

View Replies View Related

Calculate Working Days

How do I calculate In ASP how many working days are there until a particular date?

View Replies View Related

Calculate Yesterday Date

how i can calculate yesterday date using asp?

View Replies View Related

Calculate The Size Of A Folder?

How do I calculate the size of a folder? Also how do I count the number of images stored in a folder?

View Replies View Related

Calculate Time To Run A Script

how do you calculate the time to run a script in ASP VB script ? Code:

<%
start_time = ???

'run script here

end_time = ???

%>

View Replies View Related

Calculate USPS Rates

Has anyone seen a decent script for getting USPS rates live in your own shopping cart?

View Replies View Related

Calculate Total Records

i have some problem in showing data. I have two tables . First table(containing Hosting categories). Second table(Containg catagories data like l,keyword,description.....etc). I want to display catgories names from first table and then diffrent catagories total records from second table, like this

ASP.NETHosting(10)
Linux Hosting(20)
Windows hosting(13)
:
:
:
etc

View Replies View Related

Auto Calculate Total

i need some help with my asp project. there few text field . for user to enter in amount. and i need the system to auto calculate the total everytime user finish enter amount in a text field. another problem is how can i make the text field accept number only?

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved