RGRestricting decimal places in table cells.
Added by Rajeev Gajbhiye over 13 years ago
I am using WTableView to display a time series. The problem is that it displays number to several decimal places. How can I restrict it to only display say 3 decimal places?
Regards,
Rajeev.
Replies (4)
TS RE: Restricting decimal places in table cells. - Added by Thomas Suckow over 13 years ago
RG RE: Restricting decimal places in table cells. - Added by Rajeev Gajbhiye over 13 years ago
That worked!! I recall that when working on JWT, we had set "#0.000" as text format and it worked. With Wt, it doesn't. Any comments?
Regards,
Rajeev.
TS RE: Restricting decimal places in table cells. - Added by Thomas Suckow over 13 years ago
My guess is JWt and Wt use different formatters. Wt uses snprintf (or compatible) and my guess is JWt uses some java format syntax.
-Thomas
KD RE: Restricting decimal places in table cells. - Added by Koen Deforche over 13 years ago
Hey Thomas,
Indeed that's spot on. This is documented here (for C): http://www.webtoolkit.eu/wt/doc/reference/html/group__modelview.html#ga57b5cadd177847f51eaeb0cee23782c1 but the documentation doesn't point this out for Java. I've filed a bug for this: http://redmine.emweb.be/issues/1813
Regards,
koen