Just Adding Two Numbers
i am adding two form variables but they give out put as concatinating and not adding
taking two textboxes / and a subjmit button . givin 30 and 20 in both text boxes and submit is add code and i am getting 2030 as answer instead of 50. can uany one help with a code?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Adding All Numbers
regarding adding or getting sum all of the numbers in the database fields example of the Fields: Totay_Payment 10.00 20.00 30.00 40.00 My problem is i cant display the exact SUM of all numbers and it goes like this 10.0020.0030.0040.00 and i want the exact sum like this 100.00 heres the example of my script : inTotalPayment = rsSumNumber("Total_Payment") Do While Not rsSumNumber.EOF intSum = intSum + intTotalPayment rsSumNumber.MoveNext Loop Response.Write(intsum)
Adding Numbers
Is there a way to add numbers (currency) of the one column which is queried with sql from access database?I mean some asp tag or something, or I must use javascript?
Adding Numbers
I'm trying to get the sum of request.form("AAA") & request.form("BBB"), but when it add the 2 together, i don't get the sum. For example. request.form("AAA") contains a number 1 request.form("BBB") contains a number 2 i want them to be added to get 3 but i get 12 instead Code:
Problem Adding Numbers
I am producing a table of numbers using a Loop but seem to have trouble getting a total. For example, if I have 3 numbers that get outputted in a table like so: 123.45 678.90 123.45 My total ends up as 123.45678.90123.45 And I use the script: Dim intNumber Dim intTotal Do While Not rsNumbers.EOF intNumber = rsNumbers("Number") intNumber = FormatNumber(intNumber,2) Response.Write intNumber intTotal = intTotal + intNumber intNumber = 0 rsNumbers.MoveNext Loop
Adding Numbers Vbscript
I have a problem for adding a verbal to itself on click of a button. i want variable a to always hold the value and add the new value to it i submit the form. At the moment it adds to itself onclick then adds the new number to itself.... Code:
Adding All The Numbers On A Field
i know this is a very lame question but dyu have any idea on how to add all the number on a specific field? for example AGE 3 4 7 4 6 8 then i want to get the average age... is there a sql command for this? and how do i display it on my asp page?
English Numbers Into Arabic Numbers
I'm working on asp project, access 2000 at backend.I can write arabic text and arabic numbers in textbox and save them in database.but if i see these records, arabic text and arabic numbers,it is ok,if my computer is arabicenable. If my computer is not arabic enable then it show arabic number into english numbers. how can i show arabic numbers instead of english numbers if my computer is not arabic enable.i'm working on a project i have to complete it.How can i convert english numbers that are coming from database and convert that numbers in arabic for show. I have use <meta http-equiv="Content-Type" content="text/html; charset=windows-1256"> I shall be very thankful to you for this purpose.
Getting Two Numbers
Just started learning ASP about ten minutes ago. Currently experimenting with forms. could someone please tell me what is wrong with this code:Code: <% Resonse.Write Request.Form("myform") + Request.Form("myform2") & "<br />" %> Im trying to get two numbers to add together from a form. I get this error when i use that code: Quote: Microsoft VBScript runtime error '800a01a8' Object required: '' /Jaynesh/asptest.asp, line 14
Even Numbers
how can i check if a variable is an even number
Add Two Numbers
i want to add two numbers in server script with VB script. how to do it.
Add Numbers Using Checkboxes
I Have this form in page1: <form method="post" action="page2.asp"> <input type="checkbox" name="numb" value="10"> <input type="checkbox" name="numb" value="20"> <input type="checkbox" name="numb" value="30"> <input type="checkbox" name="numb" value="40"> </form> Now what I want is to add the checked values in page2. For example : if checkbox1 and checkbox3 gets checked I want to add the values in the checkboxes which in this case is 10 + 30 and get the total sum (40). Hope this makes sense? So how do I retrive the checked values and then add the checked values with eachother to get the total?
Random Numbers
I am developing a online test application(multiple choice ques) So for that i need to shuffel the questions randomly. eg there will be 60 Questions in total. If say 50 users are connected to it, all will be having same 60 questions but its order should be different. i am using below code to randomly generate questions numbers but the problem with this code is it is repeating the number.I want to generate non repeatable numbers. Can anyone help me out to do it. Dim my_num,max,min Dim i i = 0 max=60 min=1 For i = 1 to 60 Randomize my_num=int((max-min+1)*rnd+min) Response.Write my_num & "<br>" Next
Ordering Numbers?
i need to oredr a set of numbers. the numbers are "06/9","95/1","95/6","06/3" and so on. the thing is that these need to be ordered form the second number, so it shoudl be ordered thus: "95/1","06/3","95/6","06/9". how can i do this? at the moment just as an attempt im splitting the number either side of the "/" like this: var regNo = "12/09" var yearStart = 0 var yearEnd = regNo.indexOf("/") var year = regNo.substring(yearStart, yearEnd) var itemStart = regNo.indexOf("/") + 1 var itemEnd = regNo.length var itemNo = regNo.substring(itemStart, itemEnd) but where do i go form here?
Trim Numbers
I am converting bites to Megabytes in an operation. How would I trim the result to only go to 2 decimal places?ex: Response.Write(file.FileName & " (" & (file.Size/1048576) & "Mb)<BR>")
Check This Numbers
i know how to code it in javascript but failed to do it in asp. there are 12 digits of number. exmple like this 871205106599. i want to check every single digit when user clicks Submit button.
Round Numbers
I want to round numbers to include a 0 at the end. response.write "<td bgcolor=white align=center class=menuText>" & 100 - Round(CTASCAvail,2) & "%</td>" response.write "<td bgcolor=white align=center class=menuText>" & 100 - Round(Avail,2) & "%</td>" the following code will round the numbers 2 decimal places but if it is a 0 it will not display it.
Ensure Only Numbers
I believe this is possible using Regular Expressions (which I have never used), but I am unsure of any other way to do it. Either method would be acceptable for me - I need to learn how to use Regular Expressions some day How do you ensure that only numbers are entered into an input field. I need to know this for things like postcodes, phone numbers etc. and a few other things and I've never come across an easy way to do it
Random Numbers
I know thats theres already a few posts about this subject but I need to create 3 random numbers of any size, I've used the following code -: randomnumber1 = int(rnd*9)+1 randomnumber2 = int(rnd*9)+1 randomnumber3 = int(rnd*9)+1 but it always returns, 7,5 and 6.. Not very random as you can see
Encrypt Numbers
Can RSA encrypt a sequence of numbers and letters intermingled together. I was told that RSA can only encrypt letters,i'm not so sure. So can it bge done
Listing Numbers
I have 2 textboxes - "from" & "to". Assume I enter number 1 in "from" and 10 in "to" - I want the ASP to return: 1,2,3,4,5,6,7,8,9,10 and insert this into an Access database over 10 rows into the 'number' field. Anyone got any ideas how to do this?
Random Numbers
I have a problem creating random numbers. I basically have this Randomize() iRandom = Int(10 * Rnd + 1) If I do not wait a few sec before hitting the page again it will create the same random number as generated a few seconds before.Any idea why it is like that? Another way to reprocess the "bug" is to just fit F5 few times in a row and you end up with the same number being generated. Its annoying and I need some help to "fix" it!
Random Numbers In C#
I am trying to generate a random number between 1 and 100 into a label, using c#....
Regexing Through Numbers?
In our database I have various phone numbers, and they could start with 082 / 083 / 084 / 072 / 073 / 074. How do I check any of these and change them to 2782 / 2783 / 2784 / etc etc?
Version Numbers
I've got an ASP app. This app is deployed to two seperate Windows NT machines which I believed were the same. Unfortunately, the app works on one PC, but on the other I get some EOleExceptions from the COM object I use with the page. Does anyone know how I can check versions numbers of things like what ASP engine I am running (if there is such thing), version numbers etc. etc. I'm just looking for anyway of telling what the difference is between the two PC's. P.s. I know this isn't really a 100% ASP based question, but I thought I would get a fast answer on the ASP board.
Split Numbers!
The number '60' can be written as (50+10) or (25+35) or (15+45) or (7+53) etc... but I want the output as (50+10) only when 60 is typed in a textbox & the Form is submitted. How do I do this?
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?
Long Numbers
How do i make this number shorter?like 65.3846153846154%.how to make it like.let's say 65.39?
Rounding The Numbers
I'm using asp, obviously, and mysql. My prices are using the decimal field type... what can I do to make it round up the the nearest 5?
Numbers Instead Of Text
I'm using the follwoing code to retrieve some values from an Access database: <% Dim PageStr PageStr=Request.Querystring("PageStr") SQL="SELECT * FROM images WHERE page = '" & Replace(PageStr, "'", "''") & "'" set conn = server.createobject("ADODB.Connection") conn.open "ContentDBase" set img=conn.execute(SQL) %> This works fine. However, I want to change the 'page' field from a string to a number (i want to filter by the primary key rather than the description), but using the existing code I'm told I have a 'type mismatch' or something. I'm guessing I need to modify the code slightly to deal witha number field as opposed to a text field?
Query By Numbers
I'm trying to do a query selecting records the have a number 4, 5, 6, or 7. If I change the datatype to text the statement works. Anyone know why the statement won't query a number?
Rounding Numbers
I've got this script, and its been giving me this result as seen below. 2 questions I would like to ask.. 1. How would I modify the below script in order to round the numbers?. (Script further down.) 2.You see the output result where it says 3268.19?, the white space next to it means the 'Parts' record set is blank but did have a weight value, now how would I substitute the word "NA" for the white space being shown? .....
Rounding Numbers
I'm trying to work out how I can round off a number that the user inputs. I need the number to round up to the nearest 50. For example, if the user enters 234, I want it to round up to 250. If the user enters 51, I want it to round up to 100. Has anyone got any suggestions for coding?
Get Numbers In A String
Lets say i have these examples: Example1: text12345.asp Example2: text321.asp Example3: text214412311123.asp How do i get the number in the string. In example 1, the output should be: 12345 In example 2, the output should be: 321 In example 3, the output should be: 214412311123
Round Numbers
i am stuck on rounding i have a variable which holds a number like this a=234.56789 and i want to display only 234 so i did like this a=Formatnumber(a) and output is 234.56 but i only need 234
Round Numbers
how to round off numbers i have tried 2 different ways but hitting the dead end. say for example the number stored in my variable is strnum="112" i want to round it to 115 so my new value will be strnum="115" . so if its 113 it should be rounded to 115 . if its 116 or 117 or 118 or 119 it should be 120 . if its 111 or 112 or 113 it should be 115 . how i can round the numbers.
Numbers Beginning In 0
I'm trying to build an href using rs data from an access database. the link is this: Code: <a href="http://localhost/DISCS/<% = "" & rs.fields("DiscNo") %>/<% = "" & rs.fields("DiscNo") %>-<% = "" & rs.fields("TrackNo") %>.wav">text</a> This works fine unless the "TrackNo" number starts in 0: as in 01, 02, 03, etc.The field "TrackNo" in my database is a numeric field.Anyone know how I should format this? I tried <% "" & CInt(TrackNo) %> but that didn't work./Still the output from it was without the 0 at the beginning.
Using Numbers From MS Access
I have numbers stored in MS Access like 1, 2, 3, 4... and when I list these on a page ordering by ascending they appear as: 1 2 3 4 which is fine and well until I have 10 or more entries... 10 11 1 2..... how can I make them come out how we would expect them to come out i.e. 1 2 ... 10 11
Find Numbers
I want to find numbers in one comma seperated string which are not in another one. For instance if I have two strings "strString1" and "strString2 how can I find numbers in "strString1" which are not in "strString2" Example: strString1 = "1,3,6,12" strString2 = "1,6" In this case the numbers I want to end up with are 3 and 12.
Format Numbers
I have the following html with result set. I like to have gas_revenue display like $99,9999 and I like to have gas_price dsplay like 9.99. Can I use html to accomplish this? <td align="right"><Font class=content4><%=ars.Fields("GAS_REVENUE")%></td> <td align="right"><Font class=content4><%=ars.Fields("GAS_PRICE")%></td>
Rounding Numbers Up
I am working on a shipping calculator, and basically need to round up a number to the nearest 1 and am unsure how to go about it, any ideas?
Calculations On LARGE Numbers
I am trying to do some calculations on large numbers (ie 7,768,489,957,892,578,474,792,094 / 12,280) and no matter what I do it doesn't get it quite right. Its always somewhere between 10 and and 5000 out :( I have a suspition is could be down to one of the number functions I am using along the way but im not sure.
Reformat Numbers After Formatting
1. I have formatted a no using formatnumber(mynumber,2) 2. After formating it i display that no if a text box. 3. User has 2 options, keep the no as it is or change the value. 4. if user dont change that number then i have to convert that no format back to the original format and add to the database. So help need how i can reformat the no which was formatted.
List Of Employee Numbers
I have an ASP site that allows the user to submit an Employee Number to an Oracle procedure. The procedure does some calculations and the results are displayed in the browser. Now, the user would like the ability to submit any number of employee numbers all at once (though not display the results). I think this can be done, but I'm not entirely sure how to go about it? I think the way to approach this would be to get a comma separeated list if employee numbers and convert it into and array using SPLIT, and then churn through the array and pass each record to the Oracle procedure. So my question is, how do I get the comma separated list into ASP? There could be as many as 6000+ entries in the list.
Numbers Are Not Being Displayed Properly
I am unable to get this function to output the correct output. The Subtotal works fine, but the GST and TOTAL are not working properly. GST only shows the integer value and nothing after the decimal places. Code:
|