Formatcurrency Puts ( ) For Negative Numbers
formatcurrency function puts ( ) for negative numbers(e.g. (111) ). How can I display the negative numbers with a minus sign infront like -111.
View Repliesformatcurrency function puts ( ) for negative numbers(e.g. (111) ). How can I display the negative numbers with a minus sign infront like -111.
View RepliesI have two URLs. Static.htm and dynamic.asp
Static.htm
Contains a form with two text boxes, called text_1 and text_2 and some other info that is irrelevant for my question.
Dynamic.asp
Need some code to check that the text boxes only contain values greater than 0 and only numbers. Thus if any of the textboxes for example contain -3 or the letter m I want to cancel the form submission and display some kind of error message.
How can I achieve that?
When inserting a value into a SQL Server DB of data type money, I have by value in the application formatted using FormatCurrency. When the value is passed into the stored procedure, do I need to strip off of the dollar sign ($), before passing in the value to the SP?If so, how would you strip off the dollar sign using the vbscript string methods?
View Replies View RelatedThis is probably a simple one for you. How do I write the following
I want to say
if AcceptCancel=Accept and VStatus is not equal to X Then
If ((AcceptCancel = "Accept") AND (VStatus != "X")) Then
The mistake is probably the "!". Where do I put it?
This is only part of my code. I want to add FormatCurrency() funtion before in/before the "salary" part. I should format plain number I request from my database (ex. 1000000) into $1,000,000. how to merge that two things together?
<%
do until rsEMP.EOF
response.write("<tr>")
response.write("<td>" &rsEMP("lastname")& "</td>")
response.write("<td>" &rsEMP("salary")& "</td>")
response.write("</tr>")
rsEMP.MoveNext
loop
rsEMP.close
%>
I want to add FormatCurrency() funtion in/before the "salary" part. I should format plain number I request from my database (ex. 1000000) into $1,000,000. It would loop by itself.
Does anyone know how to merge that two things together?
<%
do until rsEMP.EOF
response.write("<tr>")
response.write("<td>" &rsEMP("lastname")& "</td>")
response.write("<td>" &rsEMP("salary")& "</td>")
response.write("</tr>")
rsEMP.MoveNext
loop
rsEMP.close
%>
I've just finished a site for a client and am just sorting out some of the
finer elements of the site.
The client wants prices formatted like
£8
£11
rather than £8.00 or £11.00. If the price is £8.50 then it has to show
£8.50.
Could anyone advise on the syntax for formatting the price in this way? I
haven't got a reference book with this in, and haven't had much luck
searching the archive.
I was going to use the DateDiff function for something, so I looked up the syntax real quick at w3schools. Here's what they have:
document.write(Date & "<br />")
document.write(DateDiff("m",Date,"12/31/2002") & "<br />")
document.write(DateDiff("d",Date,"12/31/2002") & "<br />")
document.write(DateDiff("n",Date,"12/31/2002"))
Output:1/14/2002
11
351
505440
I put the same code into a simple test document to verify, except for mine has Response.Write. All my numbers came out negative. If I reverse their positions, I get positive numbers. Is the example above wrong or is there something going on with my PC?
I am trying to turn negative numbers to dispaly the value of 0. I have a field called new_past_due I am looking for something like this >
**********************
<%IF new_past_due = >0 then new_past_due = "0"%>
Is there anybody out there that knows the anser to this one?
I got the following line in the formatcurrency statement that is giving error.
Response.write "<TD ALIGN=RIGHT WIDTH='10%' >" &
FormatCurrency(TotPersonnel) & "</TD>" & vbCRLF
The error message is: Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'formatcurrency'
/gwisprod/FSR_EditDetailPrint.asp, line 345
I found out that if TotPersonnel field contains null value, the above error gets generated.
IN an ASP page I am using the following number formatting for currency, Code:
<%=FormatCurrency(RS("increvhigh"), 2, -1, -1)%>
When I put in my data as a negative number, it is saved to the Access database with parenthesis around the negative number. When I go to the ASP page to display records as line items, the record with the negative value will not display.
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.
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
how can i check if a variable is an even number
View Replies View Relatedi want to add two numbers in server script with VB script. how to do it.
View Replies View RelatedI 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?
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?
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>")
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.
View Replies View RelatedI 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.
how to add two numbers from two different textboxes and display it in the third box.
View Replies View RelatedI 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
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?
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!
I am trying to generate a random number between 1 and 100 into a label, using c#....
View Replies View RelatedIn 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?
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.
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?
View Replies View Relatedi 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?
How do i make this number shorter?like 65.3846153846154%.how to make it like.let's say 65.39?
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?
View Replies View Related