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


ADVERTISEMENT

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

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 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

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

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

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

XML Formatting

I’m having an issue saving/reading an xml file.The source of this file is a the parameter of an object. Through the UI the user can change the value (xml string) of this parameter.

The problem is that the parameter needs the xml with > , < , and " instead of the > , < , " chars. However when I save it, the xml dom and even the fso save it with the actual xml chars. Other than a literal search, is there an easy way to convert the file to have the special chars?

View Replies View Related

ASP Formatting

Im looking for an online site that I can format or tidy ASP pages. If any one also knows of a software application that can format asp /html pages id be greatfull of that link too.

View Replies View Related

Tag And Formatting

I'm having users enter a message into a textarea, but I'm having problems with the formatting. How do I add " " characters where they have pressed enter?

This is being entered into a MySQL database, so I have already replaced the ' with '.

View Replies View Related

Formatting Variables

I am requesting a variable for the users' network username:

<%=Request.ServerVariables("LOGON_USER")%>

This returns the following:

NETWORKJ.Bloggs

Instead I would like it to return J.Bloggs on it's own with out the "NETWORK" bit so basically I am saying how do I cut out the first 8 characters of a variable.

View Replies View Related

Report Formatting

I have users typing in information into a text box. Sometimes this information can be lengthy and contain simple formatting such as spacess between lines and line numbering. For example:

1. List item number one

2. List item number two

I then have a report page that prints out this information. Unfortunately, the line spacing doesn't show up in the report. It's just all jumbled together. I'm just using <%= Notes %> to show the db field. Is there a way that I can show the formatting that was originally entered or do I need to use some kind of word processor like I am using to type this post?

View Replies View Related

Form Formatting In Asp

I would like to know how to format phone numbers and ssn numbers in textbox. That is when I enter the phone number, it is going to the database as 000,000,0000. I want to have it as either 0000000000 or 000-000-0000. Likewise, for ssn also. I am really fed up with javascript, somehow, it doesn't work well for me. Always, get page errors and it is not that easy to find out the errors in javascript.....

View Replies View Related

Date Formatting

i have a date in the following format: 12/1/2003

how do i reference just the 'day' portion of this date - in other words '1'

if the date was 12/10/2003, then i would just want the '10'

View Replies View Related

Time Formatting In ASP

I'm developing in ASP/VBScript using DreamweaberMX, w/ an Access 2000 DB as the
data source. The source of the data is coming from a third party, which I get as
a CSV and import into the database, updating it weekly.

Since I have no control over how the data is collected, I'm not sure how to fix
this problem, but here it is.

This is a database of movies and among the many fields I import is one for the
movie's length, expressed in HH:MM:SS. This comes into the Access DB as a
Date/Time format, which means all the dates, displayed raw in the DB, look like
"12:09:52 AM". Through data formatting, however, displaying it to the client as
HH:MM:SS is no problem. (Display "12:36:00 AM" as military time (00:36:00) tells
me the movie is 0 hrs, 36 minutes, 0 seconds long. Follow?)

But in an update form, which we'll use to correct errors (and there always seem
to be errors in the running times of movies), I can't figure out how to display
it in the HH:MM:SS format in an INPUT field and have it submit without throwing
a data type mismatch error. It seems to want to display as "12:36:00 AM"

Converting the field to a text type is out of the question at this point, so I
know I need to do some type of string manipulation prior to update. However, I'm
lost ...

Any ideas?

View Replies View Related

E-mail Formatting?

When e-mailing invoices and estimates, is there any way to customize the
presentation of the e-mail beyond changing the message? Specifically,
I'd like to add some html so the receiver can click on a link to pay
online. As it is, I can type the URL in the message, but it appears only
as text to the reader, not a hotlink, which, unfortunately, is quite
vexing to some of my clients.

It would also be nice to add a company logo, etc. to the email body.

On this same subject, is it possible to send the entire invoice/estimate
as HTML rather than an attached PDF? I haven't seen these options
anywhere.

View Replies View Related

XML DOM And Saving Formatting?

I'm currently doing some work with ASP and XML DOM.

Is there any way when saving XML to get ASP to save it in a formatted way? Similar to PHP's formatOutput setting? At the moment my xml is being appended on line e.g

<test>1</test><test>2</test>
Is there a setting to get ASP to save XML like:

<test>1</test>
<test>2</test>

The XML document I'm working on is fairly large and its proving very difficult to read through the xml at the moment.

View Replies View Related

Formatting String

I have one string variable and value stores something
like this:

st = "From: ""John Thomas"" <john@test.com.au>"

when i test it display some thing like
From: "John Thomas" <john@test.com.au>

How can I pick up only display name and without double
quotes. i.e. it should display only

John Thomas

View Replies View Related

Correct Formatting

I am trying to parse this response.write string but its coming up with a formatting error - can someone please tell me where I'm going wrong?Code:

Response.write ("<input name=""URL"" type=""text"" value=""http://www.evolvewebsitedesign.com/news-indiv.asp?news=" & rssite("News") & ""/>")

View Replies View Related

Correct Formatting

I am needing to response.write a variable within a snippet of Javascript.
My Javascript code that I need to response.write with the variable is below:-Code:

response.write ("imageArray[ImageNum++] = new imageItem(image_dir + ""variable here"");")

I can response.write the static Javascript string fine. The problem arises when I try and state a variable into where it says, 'variable here'
The variable I need to include is
Code:
rs.Fields("ImgURL")
Would someone please be able to show me the correct formatting for this Javascript string which includes the variable.

View Replies View Related

Save Formatting

Is it possible to have line feeds/breaks automatically entered when the text wraps to a new line? I am using a <textarea> input on a form and using the <pre> tag when displaying the text to a html page (embedded in a .asp page). The text is being saved to a sql database. Returns seem to be displayed. But the wrapped text just displays as one long line.

View Replies View Related

Formatting Columns

I have a SQL 2000 table with data I display in three columns. The code
I am using sorts the data horizontally but I need it sorted vertically.
Here's the code I am using. Perhaps somebody can help me find a way to
modify it.CODE

response.write "<table width='100%' cellpadding=1 cellspacing=0>"
if not oMain.eof then
count = 0
do while not oMain.eof
if count mod 3 = 0 then
'there are 3 in the current row, so end the row and start a new
one...

View Replies View Related

Date Formatting

I am trying to display dates in a spreadsheet, but the dates need to be in a
format that will allow them to be sorted in Excel. The datatype in the SQL
Server database is datetime. In this case, I need to display the date only,
not the time. But I don't want to change the datatype in the database
because the time is used in other places.

So what I am doing is pulling it out of the database, then modifying it in
ASP/VBScript by using the datevalue function. This results in values such as
3/31/2006, 4/3/2006, and 4/14/2006. The problem is, the ones with the
single digit date (4/3/2006 in the sample data I just listed) messes up
Excel's sorting capabilities. How can I force the dates to display in a
2-digit date format? It would probably be good to do the same for the month.

View Replies View Related

Formatting Percentages

OK, I know about FormatPercent and it changes a decimal into a percentage, but is there an analagous function to change a percentage into a decimal value?

View Replies View Related

Date Formatting

does anybody know if you can change the format of
a date from the us version 10/20/04 to the european way
20/10/04?

View Replies View Related

Text Box Formatting

I have an ASP site pulling from a SQL Server. When I pull a text field from the database into a text area, it keeps the formatting. If I pull the data from the database on a response.write, all of the formatting is lost. how can I prevent this from occuring?

View Replies View Related

Formatting PDF Colors

I have a report that I render out as PDF. I have two sections in my Details section of the report.
I want to format the background of each section. so one half will be one colour and the other half will be a different colour.

Anyone know how I can do this?My Details section simply consists of labels and database
fields.

View Replies View Related

Formatting EXCEL

I am using the response.ContentType = "application/vnd.ms-excel"----Works GREAT! I send all my SQL querie info from my asp page to an excel spreadsheet. Now what I need to know is there some fuctions I can use to set all the format parameters of the spreadsheet i.e. font style and size, columns to autofit!!

View Replies View Related







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