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
ADVERTISEMENT
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
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
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
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
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
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
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
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%>
<%End If%>
I have tried it in various places but i can't get it to work
View Replies
View Related
I currently have a variable that is pulled from a database for currency amount. Ex: 25.99 . I need to remove the decimal place so that the variable is like 2599 instead. How can I use ASP to remove this decimal place?
View Replies
View Related
if we use formatnumber library function in asp it will format the no as per the number format defined in the locale of the server. For example:
some number format look like this 34,135,200 (comma seperated)
some looks like this 34 135 200(blank spaces seperated)
so does anybody have a vbscript function which do this job.
View Replies
View Related
I have a querystring that passes through the value 001 for example, the form on the receiving page need to display that number but with 1 added to it. i have
dim strnum
strnum = request.querystring("value")
strnum = strnum + 1
when displayed <%=strnum%> shows 2 instead of 002, and the zero's are very important, is there any number formating trick i dont know or another way of doing this?i thought about coding the first two zero's in before i call the strnum but this would mess things up when i get to 010 etc.
View Replies
View Related
How do I write? Code:
Dim johnson, jordan
decnum = Request.Form("decnum")
decnum = Cdbl(decnum)
If decnum is "a decimal number" between 4 AND 8 Then
jordan = 23.90
End If
View Replies
View Related
how do i round off a number to 2 decimal places? This code taken from www.w3schools.com only round the number to a whole number.
<html>
<body>
<script type="text/vbscript">
i = 48.66776677
j = 48.999
document.write(Round(i))
document.write("<br />")
document.write(Round(j))
</script>
</body>
</html>
View Replies
View Related
I would like to format URLS that are being retreived from a database. Here is an example:
bodytext="this is some text http://www.sitepoint.com/ this is some more text"
response.write(bodytext)
how could I change the URL (http://www.sitepoint.com/) to a link? So instead of http://www.sitepoint.com/, it would be <a href="http://www.sitepoint.com/">http://www.sitepoint.com/</a>. There are going to be an infinate amount of URL's (the user can type in any one) and it is just not the URL by itself.
View Replies
View Related
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
I want to be able to format a year as mm/dd/yy
formatdatetime does not work because the year is yyyy. How do I format a 2 digit year such as 04 for 2004?
View Replies
View Related
When i send a text string to my database linebreaks are stored, but when i call it from asp to the page all linebreaks are lost.
this will reformat text to look different than i was initially typed, how can i make the text shown on webpage in orginal formating.
hope im clear on this or ask and i will elaborate.
View Replies
View Related
does anyone know if there is a function to format date?When my date is extracted from database, it is in decimal format (ie.38233.72078), is there a way to convert this number to date formate using asp?
View Replies
View Related
I have a list of dates in a sql database that are input as varchar like this 042999
How do I insert / in between the date/month and year
so this 042999 will appear like this 04/29/99
View Replies
View Related
Having a pretty annoying format 'error'
The below code works fine,
strMessage = "Logged in as: " & Session("UserName") & ""
but it displays as:
Logged in as:
'Username'
Were as i want it to be:
Logged in as: 'Username'
Any ideas how to make it go to one line?
View Replies
View Related
I posted before about replacing special characters (esp. '). However, I am wondering how formatting can be kept when entering it into a textbox to store in a database?
When text with seperate paragraphs is entered, it comes out as one big paragraph later on.Is there anyway to address this? When I was doing my searching - somethign about chr(10) kept coming up, but I am not sure what this is.
View Replies
View Related
I have an ASP page taking data from a table. I would like that the data is shown as a % (like 51.456897%) All it shows with my code below is 0.51456897.
Can someone tell me how to change the code so that my % is shown? ....
View Replies
View Related
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
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
I am importing a time into a sql datetime field from a text datafile using vbscript in an asp file. The time coming in will look like 8:00 or 3:30 or some other similar thing.
Because it is doesn't have am or pm associated with it, I have to force the issue or sql will assume am all of the time, and I am sure that no judge in our county is going to hear a case in the middle of the night!
So I have to add 12 hours to anthing that could be an afternoon time before I add it to the database to keep it from looking stupid in the display screens.
View Replies
View Related
I have the following variable being displayed but i would like it displayed in the default font and text size 2 how is it done?
<% response.write(sUserId) %>
View Replies
View Related
Is there a way to output a date in latin american format?
You know the day first, the month second and the year last.
View Replies
View Related
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
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
I am storing dates in a mySql database in the format yyyy-mm-dd. Now, I have set up so that this field is insert by a form.
It isn't very user friendly to have to type yyyy-mm-dd, how can I set up so that the user can enter format dd/mm/yyyy and it will automatically insert into the database as yyyy-mm-dd? I am using Dreamweaver MX 2004 and ASP.
View Replies
View Related
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
I want to convert a number to percentage or decimal,is there any built-in function for this?
View Replies
View Related