Re: macro array value limit
Posted by
Michael Doube-2 on
URL: http://imagej.273.s1.nabble.com/macro-array-value-limit-tp3701176p3701178.html
Hi Gabriel,
Yes, using parseFloat(string) fixed the problem.
Cheers,
Mike
Gabriel Landini wrote:
> On Thursday 26 October 2006 16:08, Michael Doube wrote:
>
>> What happens is that in the if loop, values bigger than 9.99 and 9999
>> are ignored. The arrays do contain bigger values, but somehow they are
>> excluded from the 'if'. I can print out values bigger than 9.99 and 9999
>> (if I simply print the arrays as soon as they are parsed). This means
>> that when the true maximum of the array should be 11.38 (for example),
>> if I print my max (from the if loop) it is reported as 9.99.
>>
>> ImageJ version 1.37r, Java 1.3.1_13, WinXP
>>
>
> Did try this on the latest version of IJ (which is 1.37u)?
>
> Another suggestion is to make sure that the splitting is parsed from string
> into a number correctly by using any of these macro functions:
>
> parseFloat(string)
> parseInt(string)
> parseInt(string, radix)
>
> Cheers,
>
> G.
>
--
Michael Doube BPhil BVSc MRCVS
PhD Student
Dental Institute
Queen Mary, University of London
New Rd
London E1 1BB
United Kingdom
Phone +44 (0)20 7377 7000 ext 2681