Currency field issue in edit mode

Posted by: cirruschris on 14 September 2017, 11:39 am EST

  • Posted 14 September 2017, 11:39 am EST

    Hello,

    I have a column within Flexgrid formatted as currency:

    { header: ‘Credit Amount’, binding: ‘creditAmount’, width: 120, format: ‘C’ },

    Sometimes when I go into edit mode and double click the cell, the value displays to 12 decimal places when it should be only 2 decimal places.

    Example:

    67745.88 displays as $67,745.88 in the grid but when double clicked it displays as $67,745.880000000005

    Please see the attached screenshot showing the cell before double clicking and after double clicking to go into edit mode. You can see the datasource being inspected in Firebug clearly shows 67745.88 but the cell displays $67,745.880000000005

    Is this an issue with Flexgrid or is my formatting incorrect?

  • Posted 14 September 2017, 11:39 am EST

    Hello Chris,

    The behaviour observed by you currently is the expected behaviour of FlexGrid. It formats the cell value only in the display mode of FlexGrid but it displays the complete value in edit mode. As a workaround, you can use wj-input control in cell edit mode to display only two decimal places in the edit mode as well. Kindly refer to the following fiddle: http://jsfiddle.net/mkgupta911/dagh0xxL/, which implements the same.

    Hope it helps.

    Thanks,

    Manpreet Kaur

  • Posted 14 September 2017, 11:39 am EST

    OK, I completely understand your explanation here:

    “It formats the cell value only in the display mode of FlexGrid but it displays the complete value in edit mode.”

    Yes I understand that if you have a formatting of ‘C’ and then enter a value of 8.123 then the display value shows as $8.12 and the “complete value in edit mode” is 8.123 since that is the underlying value. That makes sense to me. However what doesn’t make sense is that if you enter 67745.88 then the “complete value” as you call it is still 67745.88 so how does it display it as $67,745.880000000005? Is that a BUG in FlexGrid?

  • Posted 14 September 2017, 11:39 am EST

    Hello,

    Unfortunately, we are not able to replicate the issue at our end. Kindly refer to the following updated fiddle: http://jsfiddle.net/dagh0xxL/2/, which displays “123.45” value in all the cells and even on rendering it displays “123.45” in the last column. I even tried changing the value through editing in the cell and entered a value like 123.4567, which displays 123.45 when cell leaves the edit mode and displays 123.4567 when cell enters edit mode.

    I would suggest you to test the issue with the latest build of Wijmo 5 i.e. 2016v2.188, which you can download from the following link: http://wijmo.com/products/wijmo-5/.

    Hope it helps. In case the issue still persists, I would request you to modify the above fiddle to depict your issue and let us know in case you are facing the issue with any specific browser.

    Thanks,

    Manpreet Kaur

  • Posted 14 September 2017, 11:39 am EST

    Sorry there must be some miscommunication here. Your fiddle example is perfect to test with: http://jsfiddle.net/dagh0xxL/2/

    Please go into the Float Value column and enter in the number: 58288.88

    Then go into edit mode by doubling clicking the cell and you will see that the 58288.88 displays as $58,288.879999999997

    To me, 58288.88 DOES NOT equal $58,288.879999999997

    Why does the cell display $58,288.879999999997 instead of $58,288.88? We use this grid in our accounting module and our customers are complaining when they see the extra decimal places while in edit mode. Please see the screenshot attached.

  • Posted 14 September 2017, 11:39 am EST

    Hello,

    Thank you for the elaboration. We are able to replicate the issue at our end. On further investigation we could observe that the issue is reproducible if we have more than 3 digits on the left of the decimal. We have escalated the issue to the concerned team. We will let you know as soon as I get any information in this regard.

    In the meanwhile, as a workaround you can use the Wijmo 5 InputNumber in cell edit mode as a workaround as implemented in the fiddle http://jsfiddle.net/mkgupta911/dagh0xxL/.

    Hope it helps.

    Thanks,

    Manpreet Kaur

  • Posted 14 September 2017, 11:39 am EST

    Hi, Has this issue been fixed as We still able to see this issue.

  • Posted 14 September 2017, 11:39 am EST

    Hello,

    We are looking into this issue and let you know by tomorrow.

    Thanks,

    Manish Kumar Gupta

  • Posted 14 September 2017, 11:39 am EST

    Hello,

    This issue is with the development team with tracking id 255751.

    We will let you know as soon as we get any update on this.

    In the meantime, please use workaround provided in previous reply.

    Thanks,

    Manish Kumar Gupta

  • Posted 20 January 2018, 6:21 am EST

    Hi,

    We are sorry for the late reply.

    This issue has been verified as fixed with the build 5.20173.403. Please refer to the fiddle:

    http://jsfiddle.net/mkgupta911/dagh0xxL/1/

    ~Manish

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels