FW: [Javascript] any way to add a zero to a number

Muchacho, Laurent (TWIi London) LMuchacho at twii.net
Thu Jun 13 12:04:37 CDT 2002


Hi scott 

I think Josiah Gordon already answer to that question 

Laurent 



-----Original Message-----
From: Josiah Gordon [mailto:jgordon at directfile.com]
Sent: 12 June 2002 02:01
To: javascript at LaTech.edu
Subject: RE: [Javascript] any way to add a zero to a number


Try creating a string variable and appending your variable to "000". In your
database read the var in as an int.

	var str = "000";
	var num = 1;
	str += num;
	document.write(str); // ==> 0001

That work?

Josiah Gordon


-----Original Message-----
From: javascript-admin at LaTech.edu [mailto:javascript-admin at LaTech.edu]On
Behalf Of Scott.Wiseman
Sent: Tuesday, June 11, 2002 5:51 PM
To: 'javascript at LaTech.edu'
Subject: [Javascript] any way to add a zero to a number


I really want 0001
but I get 1..

this is not good
for my database

Scott

p.s. Thanks for everyone's help so far.
_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript


_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript


DISCLAIMER - The preceding e-mail message (including any attachments)
contains information that may be confidential, may be protected by the
attorney-client or other applicable privileges, or may constitute non-public
information.  It is intended to be conveyed only to the designated
recipient(s) named above.  If you are not an intended recipient of this
message, or have otherwise received it in error, please notify the sender by
replying to this message and then delete all copies of it from your computer
system.  Any use, dissemination, distribution, or reproduction of this
message by unintended recipients is not authorized and may be unlawful. The
contents of this communication do not necessarily represent the views of
this company.



More information about the Javascript mailing list