Hi all,
I have a 1D array containing 96 elements. I change it
into a 2D array then print it out: each line/row is an
element with whatever columns I want. The problem is
that if the column number is < 10 I can print out
the format that I want. If the column number is >=10 I
still can print the results but the format is changed.
Also I use object#inspect method to check the data
structure: both of them are an 2D array. If the 1D
array is defined as _1D_array=1..96 then change it to
a 2D array no such problem happens. Any comments?
Thanks,
Li
#script
_1D_array.each_slice(s) do |i|
_2D.array<<I
end
pp _2D.arry
## if column is 8
[[2294.4, 3481.2, 2716.7, 1672.2, 1135.3, 2103.5,
591.1, 648.5, 603.0],
[11900.4, 10823.3, 10090.5, 3271.5, 4560.7, 3617.6,
1815.7, 855.3, 915.4],
[583.3, 601.1, 565.6, 459.2, 349.3, 358.0, 351.1,
340.2, 488.2],
[13.0, 14.1, 14.1, 16.2, 16.1, 27.1]]
##if column is 12
[[2294.4,
3481.2,
2716.7,
1672.2,
1135.3,
2103.5,
591.1,
648.5,
603.0,
477.2,
264.1,
626.5],
[459.2,
349.3,
358.0,
351.1,
340.2,
488.2,
13.0,
14.1,
14.1,
16.2,
16.1,
27.1]]
···
____________________________________________________________________________________
Cheap talk?
Check out Yahoo! Messenger's low PC-to-Phone call rates.
http://voice.yahoo.com