Go to Post It is impossible to be grumpy about anything when eating biscotti made by one's beautiful wife, drinking tea sweetened by one's own honey, warmed by a wood stove, and with a dog asleep on one's foot. Simply impossible. - pfreivald [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 11-08-2010, 05:54
sithum sithum is offline
Junior Member
no team
 
Join Date: Aug 2010
Location: kenya
Posts: 1
sithum is an unknown quantity at this point
javascript data type ?

Hi ,
I am sending a function an array of values
which contain '09' , '15','20' ,...etc
everything is working fine except when I have to do something with '09' it seems to truncate off the zero at the begining and pass to the function a 9 instead of a 09

What I want to know is how do I make the function interpert the value as 09 it seems to be converting the parameter to a number instead of the string value '09'

array[0] = '09';
array[1] = '15';
..etc

Thanks for any help
Reply With Quote
  #2   Spotlight this post!  
Unread 11-08-2010, 17:38
RyanCahoon's Avatar
RyanCahoon RyanCahoon is offline
Disassembling my prior presumptions
FRC #0766 (M-A Bears)
Team Role: Engineer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Mountain View
Posts: 689
RyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond repute
Re: javascript data type ?

sithum,
can you give more detail about what you're trying to do with the values?

I tried your example:

Code:
<html>
<body>
<script type="text/javascript">
var arr = new Array();
arr[0] = '09';
arr[1] = '15';
arr[2] = '20';
for(var i in arr)
  document.write(arr[i]+'<br/>');
</script>
</body>
</html>
which seems to render fine as
Code:
09
15
20
--Ryan
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
p1_sw_aux data type personfromhell Programming 8 02-02-2008 18:40
printing FLOAT data type on the terminal window razer Programming 14 05-02-2007 08:55
javascript ate my cereal! steveg IT / Communications 2 29-03-2004 01:10
Field Location of Type-0 and Type-1 IR Signals Travis Hoffman General Forum 3 27-02-2004 07:58


All times are GMT -5. The time now is 22:42.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi