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.
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 .
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.
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.
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:
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:
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? ....
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:
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?
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:
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%
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
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?
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:
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?
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.
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.
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.
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.
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".
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.
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.
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:
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?