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? .....
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?
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.
I need to round off a few fields to 1 or 2 decimal places but if the number is negative, it gives -0.0 or -0.00 after rounding off. Eg. -0.001356 after rounding off to two decimal places gives me -0.00...which is meaningless as -0.00 is useless Also, -0.019 should give -0.02.Tried using FormatNumber and Round functions in VBScript but still it gives the same results.
I have a page in witch 4 or so variables are loaded from a database. They are of currency format and then they are add up to get a total. Problem is that say the total is $6.10 the actual return is rounded down to $ 6.1 . How can I get it to show $6.10 , less rounding ??
If CInt(StrFirst) rounds up the value what rounds down the number i.e just show the whole number with out taking in to account anything after the decimal point?
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?
I'm trying to calculate two time fields. And when the result is smaller then 15 min, it has to round it to 15 min. Example:
begin time: 14:00 end time: 14:40 (end time - begin time = 40 minutes) result has to be: 45 minutes
The result wil be shown in a form field. This is the code I'm using (it works fine in my database), perhaps I have to adjust it for asp? But I don't know how. Code:
I'm doing up a stats page for a survey, and this is a small part of one of the results. Below is part of the code to do totals/percents. My question is, how do i make it so myAnswer is written with two decimal places?
Currently, it displays the percent as 4.76190476190476
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 had recently found a function that will write out a currency amount in words. It worked fine until I passed it a variable retreived from the stored procedure.
Well I had to change an "Int()" to "CDbl()" within the function because I got an error: "Variable uses an Automation type not supported in VBScript". I also changed an "(Abs(nAmount)" to an "(Abs(CDbl(nAmount))" because of the same error. Code:
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?
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)
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.
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
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
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.
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)
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!