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


ADVERTISEMENT

Two Decimal Places

I have searched the forum and found the answer to my problem but unfortunitly it didn't tell me how to implement the solution!
The code I have thanks to previous forums:
Code:

<%=(rs("Seconds")/60=FormatNumber(2.5,2))%>

Basiclly I want to convert the seconds to minutes and round to two decimal places.

View Replies View Related

Set Decimal Places

I need to truncate a number to two decimal places without rounding. All the functions i;ve tried tend to round up the numbers. Also i cant use any string functions to limit the size because the size can vary. example, 34.56998 must be set to 34.56 .

View Replies View Related

Decimal Places

can anyone tell me the easiest way to make sure numbers get passed with 2
decimal places?

ie:
<select name="TagCost" id="TagCost">
<option value="25.00">1 @ 25.00</option>
<option value="50.00">2 @ 25.00</option>
</select>

fprice=request("TagCost") <------- need to make sure this is 25.00 not 25

View Replies View Related

Decimal Places For Currency

I am trying to display a currency field from an access db on an ASP
page. The only problem i found is that if there is a 0 (zero) after
the decimal i.e. 79.60 it is not displayed.

I tried doing the whole var = CCur(TBL("Price")) thing but there is no
zero.

View Replies View Related

Knock Off Decimal Places

I have some code that divides a number and then prints this number. It performs a cost rollup basically and then adds a percentage. The code works fine except that the number returned has many figures afert the decimal point (as you would expect really) How can I remove these ? I am not really concerned about rounding up or down, just removing to give me a whole number.

View Replies View Related

Rounding To 2 Decimal Places

I have got the total amount of hours flown in the top left hand side of the home page and it is in hours.

Trouble is the decimal places need to be rounded to 2 as sometimes it says sometihg like 3254.63333333333 hours. I'd like it to say something like 3254.63 instead.. Code:

View Replies View Related

Rounding Off To 2 Decimal Places

can anyone help me i want to round off a number entered by a user to two decimal points for a number of text boxes.

View Replies View Related

Number Formating Decimal Places Not To Remove Zero 0 At The End

I have a report that will format a number to the last 2 decimal places. However it will trim off the 0 at the end. Example.

98.90 is formated to 98.9

how can i tell the format number function to not trim the 0 but still have the last 2 digits.

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

Format A 2 Place Decimal In Asp

What is the easiest and best way to format a form field so the numbers show as a 2 decimal format?

(i.e. 2.50 instead of 2.5). I am developing a client based form that calculates fields but cannot seem to get the number format correctly. Code:

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

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

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

Network Places

i create virtual directory on iis with network directory is a share located on another computer...after i did that ....i can't browse that virtual directory...if i browse that virtual directory ...at browser IE show message the page cannot be found

View Replies View Related

Post A Form To 2 Places...

Alright, I have a form that needs to post to form_process.asp

However, it also needs to post to another site/, say example.com/process.asp

How would I do this?

The place it needs to post to is off site, and MY form_process.asp needs to save the data before submitting it to example.com/process.asp

Possible?

View Replies View Related

Rounding Decimals 2 Places

Right now I round my number to 2 decimal places... and since I am dealing with money values I need to show $100.70...but my calculations show $100.7. Is there a way to fix this? How can I tack on a "0" if it only shows 1 decimal place?

View Replies View Related

How To Upload A File To Two Different Places At The Same Time?

This is my souce code to upload multiple file into 1 directory. How can i improve it to make it can upload to 2 different place in the same time when i click the upload button? Code:

View Replies View Related

Submit Form Data To 2 Different Places

I'm not very familiar with classic ASP, but I need to modify an existing form on an ASP site to make the form data get posted to 2 different locations. Any suggestions on options to accomplish this?

View Replies View Related

Script To Format Existing Access Table Into Wall Calendar Format?

I have the tables set up in Access, viewing in column format on ASP pages but now the company wants the schedule reports to be in a wall-calendar type format. I've searched and found calendar scripts but I need one that's creates a table resizable to a report size format. Using the existing MS Access db I've written is also a plus.

Any suggestions on where to start?

View Replies View Related

Convert Any Audio Format Files To Vox Format

if there any asp or vb functions that can convert any audio format files to vox format.

View Replies View Related

Decimal

if there is an easy way to convert hex to decimal with asp, the hex() function is there to get the decimal to hex, but i haven't been able to find a way to go back.

View Replies View Related

Decimal Value

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

View Replies View Related

Decimal Value

i want to do the calculation like

value=int(basic) * int(excise) / 100

the both value come from the form. so when the data of excise field is like decimal 16.32 then i get the error data type mismatch.because the excise is 16.32 it is a decimal value. i have used CDbl(excise) but still it gives error.

View Replies View Related

Decimal Value

My ASP driven site has always used MySQL as the DB backbone, mainly as the hosting costs of MySQL are far cheaper than SQL Server at the mo, and it has worked fine until my ISP thought that they were doing everybody a favour by upgrading to v5 from v4.

What happens now is that any ASP query that I do that involves any of my MySQL Decimal data type fields goes belly up. It will not work. Looks to be an issue with ASP, MyODBC and MySQL, but I just wanted to check if there was a better/more reliable data type than Decimal (which obviously performs the same numerical functions) and if there was a quick way to convert all of my Decimal fields to this new type.

View Replies View Related

Decimal Value

Testing a ASP page using an Access db and I have a field in the DB defined as a 'number' with a precision of 3. Upon submitting the test data, I get this error message.


Microsoft JET Database Engineerror '80040e21'Scaling of decimal value resulted in data truncation. Can anyone tell me what's going on? The test value I used was "2.5".

View Replies View Related

Hex To Decimal

Is there a quick function to check if a passed value is a valid Hex Color? ie, if FD4323 was passed, it would return TRUE, and if FD94LR was returned it would return FALSE.

I'm finding conversion functions, but nothing that tests off hand.

View Replies View Related

Decimal Conversion

Anyone have any code handy to convert a binary number to decimal and a decimal to binary? I need server-side code to perform these calculations. For example, I'd like to be able to pass 129 to a function and it will return 10000001. Likewise, I'd like to pass 10000001 to a function and get 129.
I can do this on paper, just not sure where to start on how to pass these numbers into a function to perform the calculation.

View Replies View Related

Decimal Problems

i have a script that calculates a value but when the value is for example 5.40 the textbox displays it as 5.4 because this is a money value it has to have the "0" at the end
how can i make the script so that it always has 2 decimals behind the comma or point. Code:

View Replies View Related

My Decimal Is Being Rounded Up By SQL

I have a form in an ASP page that the user enters a price for. When I send the parameter to my SQL stored Proc and refresh the data, it gets rounded up to the nearest integer. I can change the data just fine in SQL but not by using my asp page. Can anyone point me in the correct direction?

View Replies View Related

Decimal Numbers

i have the following equation:

<%
avg_score = total / count_match
%>

what can i do to restrict the result of avg_score to be of 2 decimal places?

View Replies View Related







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