FlexSheet and decimal precision

Posted by: aka.scomac on 26 August 2021, 8:34 am EST

    • Post Options:
    • Link

    Posted 26 August 2021, 8:34 am EST

    I am using FlexSheet and noticed that by default it seems to round decimals to 2 place. I would like to change this to support a higher decimal precision of like 10 digits past the decimal. Or just not format and round the numbers at all. Can this be accomplished through the itemFormatter? If so how?

  • Posted 26 August 2021, 8:21 pm EST

    Hi,

    For this, you may set the column Format to “n10” or any standard DOT Net format. Alternatively, you may use the ItemFormatter/FormatItem and set the cell innerHTML to the actual value without rounding off/formatting.

    Regards,

    Manish Gupta

  • Posted 26 August 2021, 9:51 pm EST

    Can you kindly provide a code example of setting this format? I have been challenged getting this to work. An example of setting the “n10” or the actual value of the cell innerHTML would be great. Note, I am loading the Excel file directly using the load action url of the c1-flexh-seet help tag.

  • Posted 27 August 2021, 2:58 am EST

    Is there a way to disable this number formatting all together. Because it seams that altering the cell value will not impact the value as it is represented in the formula bar or the filter list. I need the value from the Excel spreadsheet to be properly represented as they in the Excel file with any automatic formatting being applied to them. Is it possible to simply disable this functionality?

  • Posted 29 August 2021, 11:18 pm EST

    Hi, any update on this?

  • Posted 31 August 2021, 6:32 pm EST

    Hello,

    We apologize for the delayed response, kindly refer to the following points for the resolution of the above query:

    1. When we load data from an excel file, FlexSheet automatically, inherits the formatting applied in Excel (which is why it was rounding the values to 2 decimal places, as by default Excel sets formatting to 2 decimal places), To update the formatting you may try changing the formatting in Excel file, it should automatically be reflected within FlexSheet.

    2. The scenario of setting formatting to “n10” was not working because the formatting imported from excel (which was “n2”) was already defined at the cell level, and thus any changes made in formatting at column level were not being reflected.

    Thus, to summarize the above points, you may only update the formatting within Excel File and it should automatically be reflected within FlexSheet.

    Hope this clarifies your issue.

    Kindly refer to the below sample:

    Thanks,

    Dushyant Sharma

    FlexSheet.zip

Need extra support?

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

Learn More

Forum Channels