Formatting Percent And Dealing With Division By Zero Problems

I have some values that I want to display as percent, such as the
retail price/wholesale price. In some instances, the wholesale price
is zero, so I get a division by zero error.

What can I do to avoid this?

Also, how can I get this to only show two decimals, instead of it
going .##### the way it does. I want it to look like .45%

View Replies


ADVERTISEMENT

Division In ASP

When I do something like this:

AllRevenueAttnAnnual = Result1 % Result2

I get an error - Invalid character

I am trying to dive Result1 by result2.

View Replies View Related

Division

I'm trying to divide a filesize in bytes by 1024 so I'll get a filesize in Kb. I want a round number but instead i'm getting a result of ten decimals. Who knows how solve this?

View Replies View Related

Obscure Division

i know, this shouldnt be a conundrum right? one just shouldnt divide by zero. but this is suddenly happening *all over* my site. after chasing the error here and there, i simplified things down to:

response.write cstr(4/2)
response.end

and i STILL get the error:
Microsoft VBScript runtime error '800a000b'
Division by zero
[followed by the line on which the error occurs]

so i know it's not my code. how can you get a division by zero error when you'r dividing with CONSTANTS??? did i change some obscure setting or something?now mind you, i tried "response.write cstr(4+2)" and the system managed to output "6".

View Replies View Related

Floating-point Division

I have the following code in a script:

' Pecentage Interest on Loan
YearlyInterestPercent = 6.5

' Get Annual Interst Rate from Interest Percentage
YearlyInterestRate = YearlyInterestPercent / 100

' Divide Yearly Interest Rate by 12
' to Get Monthly Interst Rate
MonthlyInterestRate = YearlyInterestRate / 12

These values are supplied by the user using a form but I made them static for this example. For some reason, when dividing the Yearly Interst rate by twelve, MonthlyInterestRate equals 5.41666666666667E-03. The result should be 0.005416667. Does anyone know what I can do to correct this?

View Replies View Related

Dealing With MP3's

I would like to be able to control the downloading of (my own)music files from my music site other than letting the user right click and "Save target As" on a hyperlink.

"Save Target As" must issue a command of some sort to the server. I would like to be able to issue that command myself under program control.

View Replies View Related

Dealing With Checkbox

I want to design a page which has lots of criteria on which I want to be selected by using checkbox's. I then want to pass only the criteria that have been checked and store them in an Access DB, and leave the items that have not been ticked alone.

Anybody any ideas?

View Replies View Related

Dealing With 2 Db Tables

i got 2 tables...on the table "times" i only null the records column "dtime" (if it is not null) and save this records column "username"... straight after that i need to select on the second table "useringo" the record with the same username that its time was nulled and to null its column "msginfo"

i realy need your suggestion to how to do this...i do not want to run on all this tables every time...i want it be most minimal and smart.

View Replies View Related

Sending Percent Signs To Another Page

when sending my search criteria with a percent sign to a page that opens an excel sheet, it doesn't recognize the percent sign

ex. i enter %ABC but the value sent to the next page is just ABC

here is my excel button that sends the info to the next page. how do i handle cases where a percent sign is entered? is it handled in this page or would it be handled in the page that handles the excel? ....

View Replies View Related

Sending Percent Signs To Another Page

when sending my search criteria with a percent sign to a page that opens an excel sheet, it doesn't recognize the percent sign

ex. i enter %ABC but the value sent to the next page is just ABC

here is my excel button that sends the info to the next page. how do i handle cases where a percent sign is entered? is it handled in this page or would it be handled in the page that handles the excel? Code:

View Replies View Related

Format Percent With No Decimal Places

Where in the following line of code would i place format percent so that the output is like this
6% (no decimal places just a number and a % sign.

<%
If (lngVotesCast>0) Then
%>
<%=CLng(objRs1("num"))/lngVotesCast%>
<%Else%>
&nbsp;
<%End If%>

I have tried it in various places but i can't get it to work

View Replies View Related

Passing Percent Sign In Querystring

I am passing a sql string thru my querystring for the next page to
capture.

example: www.xxxxxxxx.com/index.asp?str=select * from table where name
like '%doe%'

Passing a basic string works fine. But, when I use the LIKE statement it
does not work. I know it's because of the % sign, so how do I translate
this thru, so that the following page picks up the percent sign?

View Replies View Related

Problems Writing Percent Character

I have written an asp funciton to write a 301 redirect. It gets the file name and the new desitination as arguments. I am doing this for hundreds of files so a script is more accurate than doing it manually and much faster, I thought. Problem is it chokes on the line: Code:

View Replies View Related

Format Percent :: Type Mismatch

I need to display the results of a query as a Percent. The data can be null, so in the query i have isnull(comns,0) Comns. When i use the ASP function FormatPercent i get an error that says type mismatch, is there any way around that error? Code:

View Replies View Related

Dealing With Friendly Urls

My application runs on ASP and the business logic is embedded in Dlls written in VB. The application hosts a list of articles for the user to view and these are accessible through some complex urls like "http://mysite/articles/category1?articleid=34512". I would like to denote a friendly url to these articles such as "http://mysite/articles/kb_TaxPlanning.asp". I am thinking of using an ISAPI filter to do the work for me. My friend was trying on using a httphandler, but it did not work. Please share with us the resources for creating an isapi filter for the same. Also how to use the same for the expected result?

View Replies View Related

Dealing With Xls (excel) Files

Can .xls (excel) files be opened and manipulated using ASP?

View Replies View Related

Dealing With Too Many Database Connections

I have a database class that I've been starting to use with my ASP apps and I was wondering about having too many database connections on one page. I'm beginning to write other classes that use the database class to reach into a table and pull data out.

Say for instance I have these classes:

Database
Users
News
Reviews

All of these classes have a method like getUserByID() or getNewsByID() but they are all using a private database object from the Database class.

Are they all using the same connection behind the scenes (underneath ASP) or are they all actually using separate connections? And if in fact they are using different connections then is there a common design patterns that alleviates the pressure by passing around the same DB object?

It makes me a bit uncomfortable to know that every class is creating a new Database object and a new connection on top of that; however, if you were pulling data from a MS SQL database for the users and an Access (ugh) database for the Reviews this would be necessary.

View Replies View Related

Recordset Dealing With Unlimited Text Field

I'm trying to query a set of data from MSSql which contains field type "text" for unlimited length of characters.

I make a query and store the data into a recordset. However, soon as the page try to access the unlimited field, it seems as if the recordset looses all the data it was holding.

Does anyone know how to get around this problem? or what's causing this? I dont even get an error msg. It just doesn't show anything as if there was nothing there.

View Replies View Related

Error :: Microsoft VBScript Runtime Error '800a000b' Division By Zero

I am accessing the same error-containing ASP page on an ISP server using w2k IE6 but with different effect. On the first computer I get several line of HTML outputed by ASP, shown correctly by the browser, followed by a descriptive error message:

Microsoft VBScript runtime error '800a000b'
Division by zero

followed by the number of the error-making line. On the second machine my HTML is not displayed at all. Instead I am getting that meaningless error page sayng that The page cannot be displayed, HTTP 500 - Internal server error. How can I get the second computer be more informative about the errors?

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







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