Question

I have a cell table that contains Number Columns, added via the GWT Designer plugin for eclipse. These equate to Column<MyObject, Number>(new NumberCell())

I can't figure out how via the API to designate formatting for the cells. The default behavior for integers is to use the a "thousands seperator", e.g. 123456 as 123,456. I want to display just the plain number.

I suppose I could just use a Text column, and frankly, I'm not sure what having a Number Column really buys me, since the column isn't editable (but may be some day), and I have to apply my own Comparator for sorting.

Should I just use a plain text column, or is there a way to specify number formatting on the column?

Was it helpful?

Solution

NumberCell uses a NumberFormat to format the number, using the decimal format if none is provided.

You can provide another NumberFormat of your choice, and if it still doesn't fit your needs (you want a plain toString()) you can simply create your own cell inheriting AbstractCell.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top