Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    setDecimalPad(2) - ListGridField not working

    Hi,

    I am using power edition.

    I am unable to get the expected result after using setDecimalPad(2) for my ListGridField.

    Here is my code:

    ListGridField rate = new ListGridField("rate","<b> Rate </b>",60);
    rate.setType(ListGridFieldType.FLOAT);
    rate.setDecimalPad(2);

    adding this to my listgrid.

    but value is not rounding off to 2 decimal digits in the grid for rate column.

    Please let me know if something is required for this code to work.

    Thanks in advance.

    Shrikant N.

    #2
    Please take a look at the docs for decimalPad. It does not do rounding. Most likely you want decimalPrecision, or for more control, DataSourceField.format.

    Comment

    Working...
    X