Login  Register

Re: Decimal Fractions in ResultsTable

Posted by David Webster on Mar 18, 2010; 7:04pm
URL: http://imagej.273.s1.nabble.com/Decimal-Fractions-in-ResultsTable-tp3688918p3688920.html

Micheal/All,

Whoops, problem solved. As it turns out, if the you are writing into the
table has no fractionbalk part, the  it is written as an int. e.g. "1.00" is
entered into the table as "1" while "1.55" is entered as "1.55". I think the
software may be a little to smart for its own good.

David

On Thu, Mar 18, 2010 at 2:58 AM, Michael Schmid <[hidden email]>wrote:

> Hi David,
>
> what about this?
>
> ResultsTable.setPrecision(int precision)
> Sets the number of digits to the right of decimal point.
>
> Michael
> ________________________________________________________________
>
>
> On 18 Mar 2010, at 03:00, David William Webster wrote:
>
> All,
>>
>> I am trying to create/display a ResultsTable containing  or showing
>> decimal fractions. But, all I get are ints. I am doing something like
>>
>> ResultsTable rt = new ResultsTable();
>> double x                = 1.0;
>> rt.addValue("x", x);
>> rt.show("My Table");
>>
>> But, I don't get the x value as 1.0, only 1. How can I get the displayed
>> and/or "save'ed" table to have doubles in it? I notice that if rt was a
>> systems result
>> table created via "ResultsTable rt              =
>> ResultsTable.getResultsTable()", then I get decimals freactions rather
>> than ints.
>>
>> David Webster
>>
>