From: Johan Veenstra Date: 2006-10-21T00:29:42+09:00 Subject: Re: How to format an array ------=_Part_62634_17951653.1161358178820 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 10/19/06, Li Chen wrote: > > Hi all, > > I have an array [1.0, 2.0, 3, 4,5,6]. I want to format all the elements > within the array into to this format "%5.3f", that is 5 > spaces/characters for each number/element, followed by 3 floating > points. Any help will be appreciate. might not be the best solution, but hey it's different from the others: ar = [1.0, 2.0, 3, 4, 5, 6] p sprintf "%5.3f " * ar.length, *ar ------=_Part_62634_17951653.1161358178820--