Preserve Zeros

How can I read back info from a database into an input field (in case it's to be edited) that will preserve the zeros to the right of the decimal?The zeros are being preserved in the access database when I have a look at it there. I have the field defined as type "Currency" to two decimal places.

I want to preserve those zeros to the right of the decimal point when I read the record into an input tag on a web page.I am trying to use "FormatCurrency(request.form(exp, 2))" and "FormatNumber(request.form(exp, 2))" but it doesn't help.

View Replies


ADVERTISEMENT

Redim Preserve

I'm trying to build an array with the ID's of the users I have in a Mysql table called tbl_user.
Here is what I coded :

dim listeId(1)
i = 0
Set rs=Conn.Execute("SELECT ID from tbl_user ORDER BY Id;")
Do While Not rs.EOF
if i = 0 then
listeId(i)= rs("ID")
else
REDIM PRESERVE listeId(i+1)
listeId(i)= rs("ID")
end if
i = i + 1
rs.MoveNext
Loop
rs.close

But I get this error: (0x800A000A)
which is something like "fixed or temporary locked array"

View Replies View Related

Redim Preserve MyArray(i)

Is it correct to think that after reducing the populated array's size from say, 10 to 5 with redim preserve myArray(i) an attempt to access an element above the fifth does not cause a compillation error "array out of script", but returns whatever heppened to
be written in that memory address (in particular it might return the correct values of those elements before re-dimentioning)?This seems to be the case in my code, yet I wanted to make sure that this isnot the result of some other side effect.

View Replies View Related

ReDim And Preserve For An ASP Array

I am implementing a site where an admin user can log purchases of items into a DB.
Obviouslt, one purchase can consist of many items. I am therefore trying to implement a 'Cart' idea wherby the user adds the items to be purchased to the cart and then completes the purchase once all items have been added to the cart.

i aM IMPLEMENTING THE CART FUNCTIONALITY VIA AN asp ARRAY. nOW I CAN Do THIS NO PROBLEM, APART FROM THE FACT THAT, i declare an array of size 10, with 5 attributes to each element. i.e.

Dim purchaseCart(10,4)

The problem is, i want to be able to ensure that if the user decides to purchase more then 10 items, that the array can be ReDimensioned to suit i.e. increase size by one every time another element is added, after it has reached its maximum size!! Code:

View Replies View Related

Preserve Line Breaks

I've got the following code which should write the contents of a textarea to a '.txt' file:

Code:

set objFileSystem = server.createobject("Scripting.FileSystemObject")
set objFilePlainText = objFileSystem.CreateTextFile(server.mappath("templates/my-text-file.txt"),true)

objFilePlainText.write(strTemplatePlainText)

If I response.write this data before inserting to the txt file, it preserves the line breaks, but when it writes to the txt file it seems to lose all of the line breaks.
Does anyone know how to get this to preserve the formatting of the text being inserted?

View Replies View Related

Preserve Input Fields

I have a .asp form page that submits to another .asp page that uses cdonts to send me an email and does a response.redirect back to the form page. I need to preserve (keep) a couple of text box values and a couple of dropdown box values.

At this point I have global.asa variables for the fields in question and they are all set to null. I can't figure out how to put the contents back in the fields, when it returns from the cdonts page. I assume that I must save all the field values in the session variables just prior to the submit to the cdonts page.

show me how to accomplich this for one text field called name and one dropdown box called PUDeliv?

View Replies View Related

Removing Zeros

Does ASP have any function to remove ZEROS from LEft??
or shoud i write one?

000025120 -> 25120
000000012 -> 12

View Replies View Related

Leading Zeros

I need to display the time in military form. I came up with the following:Code:

<%= (hour(now)) & ":" & Minute(now()) & ":" & Second(now()) %>

And this works pretty well, except I get things like this:

8:5:2 for 08:05:02
14:2:17 for 14:02:17 (2:02:17 PM)

How do I get the leading zeros before the number if it is less than 10?

View Replies View Related

Date With Zeros

is there any way to cause a date such as 6/5/2004 to show up as 06/05/2004? Just didn't know if there was an ASP function to do this or not.

View Replies View Related

Access Db Removes Zeros

i have found a problem on my webite is when i try to enter details of a new book
into the DB, i input the ISBN as its uniqueID, the problem is that if the ISBN starts with a zero,
(i.e. 07987654) the DB will remove the zero from the start of the ISBN (i.e. 7977654).
Can someone tell me how to force the DB to store the whole number including the zero at the start?

View Replies View Related

Leading Zeros Being Chopped

im inserting some data into a number field but when i have something like 0000006 it chops it to 6 in the database. and not always are the same number of zeros present. why im not sure just what i have to work with.

I understand that i could make the db value varchar and just validate it by doing something like Isnumeric. But is there a way to keep my zeros but leave it a number field.

View Replies View Related

Strip All Zeros From A Variable

I'm looking for a easy way to pull all the zeros out of a variable. They can be leading, trailing, or in the middle. I just want them all gone.

View Replies View Related

Number Formating :: Adding Zeros In The Beginning

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

REDIM Preserve "Out Of Range"

REDIM Preserve reports an "out of range".

I first create an array, store it into a session var then, in other page, I load restore the session var into a local array but, after this, I can't REDIM Preserve.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved