pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gk_br...@verizon.net>
Subject Re: Formatted value and actual data in TextInput
Date Fri, 17 Dec 2010 14:04:30 GMT
I'm still not sure I understand the problem. Let's take a simple example. Let's say I have
a ListView that displays float values. The first value is 3.14159265. When the user edits
this value, I only want to show two decimal places. I have to truncate it somehow, so I take
the floor() value: 3.14.

The user changes the value to 3.15. Now I want to go back to 8 decimal places, which would
be 3.15000000. Is that what you are trying to do?

On Dec 16, 2010, at 6:02 PM, lello wrote:

> That's exactly the case.
> The problem is the following: I have a table and the values of columns A are
> linked each other by a certain function f(). Now, when I edit one element of
> column A, all the other elements should be updated.
> However, when editing I want to display only 3 significant digits, but the
> real calculation should consider all the significant digits (not the
> displayed rounded value).
> Concrete case: two variables in the table
> A = 38.5;
> B = 11; 
> The ratio A/B must be 3.5. So if I edit A and write 12 I should get
> B=3.428571428571428, which is then 
> displayed with 3 decimal digits as 3.429. Suppose now I want to edit B.
> Double click on B, and just press
> enter, without changing the number. When I press enter the TextInput calls
> store() and valueOf(), which takes the value 3.429 as the "true" value,  and
> set A=3.429*3.5=12.001. 
> If you repeat this type of rounding error on a table after a few cycles you
> get quite useless numbers.
> Is there any way to avoid this problem?
> -- 
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Formatted-value-and-actual-data-in-TextInput-tp2099149p2101531.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

View raw message