Default Alignment of Cell data

Posted by: jonathan.pandiaraj on 11 April 2018, 5:21 am EST

    • Post Options:
    • Link

    Posted 11 April 2018, 5:21 am EST - Updated 30 September 2022, 5:02 am EST

    Greetings for the day,

    We are currently using little older version of SpreadJs 9.4 and we are seeing a behavior which we would like to know if this could be changed as a general rule or some workaround.

    There are 3 screen shot attach to show the differences

    1. A screen shot of Excel 2013 Showing Hello Text in A1 and B1 has =1/3 content (check the formula bar content)

      =1/3 is calculated as 0.333333333 but only 0.333333 is visible

    2. A screen shot of SpreadJs 9.4 Showing Hello Text in A1 and B1 has =1/3 content (check the formula bar content) =1/3 is calculated as 0.3333333333333333 but only 33333333 is visible [The expectation as similar to excel would be to see 0.333333]

    3. A screen shot of SpreadJs 9.4 Showing Hello Text in A1 and B1 has =1/3 content (check the formula bar content) =1/3 is calculated as 0.3333333333333333 and with Left Align (check the button is highlighted) 0.3333333 is visible [This is how a default alignment would be expected so that the user does not get confused the first time s/he looks at the data]

    We even tried some online demo examples with latest SpreadJs 10 or 11 and it seem the behavior is the same.

    Any help around this would be appreciated a lot.

  • Posted 11 April 2018, 7:47 pm EST - Updated 30 September 2022, 5:03 am EST

    Hello,

    I tested the issue with latest version of SpreadJS i.e. v11.0. and with online demo here:

    https://www.grapecity.com/en/demos/spread/JS/InspectorSample/

    1. The value 1/3 is calculated to the maximum allowed decimal points in a cell(by default) and the result is shown in cell as ‘0.333333333333333’. You can change it showing less decimal places by setting the cell format accordingly.

    2. By default the numbers are right aligned and text is left aligned with Spread.Sheets.

    Please refer to the attached image.

    Thanks,

    Deepak Sharma

  • Posted 12 April 2018, 3:50 am EST - Updated 30 September 2022, 5:03 am EST

    Greetings for the day,

    Thanks for the update.

    I am aware that by default numbers are right aligned and text are left aligned with Spread.Sheets.

    The issue or behavior we are talking about is when there is a default cell width and content is viewed. There is difference of behavior between Excel and SpreadJs

    With Excel the content viewed is 0.333333 (the rest of the value is hidden)

    With SpreadJs the content viewed is 33333333 (the rest of the value is either overflow to the left hand cell; and if there is content in left hand cell then rest of the value is hidden eg B1 and B2 of the new image)

    We know we could expand the column/cell width and data would be there but when cell width is default and looking at the content it can be misleading

    0.333333 vs 3333333

    Hope this helps

    Any help around this would be appreciated a lot.

  • Posted 12 April 2018, 10:07 pm EST

    Hello,

    To avoid this issue you can set the width of the column as per the content of the cell using AutoFit() method. For example:

    activeSheet.autoFitColumn(1);

    You can also set the format for a cell to only show required number of decimal places.

    Thanks,

    Deepak Sharma

  • Posted 16 May 2018, 9:32 am EST - Updated 30 September 2022, 5:02 am EST

    Hi Deepak,

    Thank you for your help so far. I’ve recently picked up this issue and would like to provide further clarification.

    For context, we use SpreadJS in an application that delivers professional exams to candidates. Candidates may not realize that the whole number is not showing, especially if it’s a calculated cell. So candidates may not know they need to expand the width or use auto-fit.

    The screenshots above show this issue as well, but I’ll use the one below to further illustrate the confusion. Cell C37 looks like the number is 56791011121. But in reality, it’s 0.123456789101112131 (see formula bar). Very, very different in magnitude. It is misleading enough that it can lead a candidate to come to incorrect conclusions about the value the cell represents.

    For numbers specifically, all other spreadsheet products that I tried (including MS Excel and Google Sheets) always show the most significant digits when there isn’t enough space, even when the cell is right-justified.

    Is the difference in behavior intentional on the part of SpreadJS, or was it an oversight?

    Thanks again for your help.

    Patrick Cummings

  • Posted 16 May 2018, 9:20 pm EST

    Hi Patrick,

    I have submitted it for review to the development team.I will let you know as soon as I get an update on this issue. The tracking id for this issue is 258391.

    Thanks,

    Deepak Sharma

  • Posted 21 May 2018, 8:26 am EST

    Hi Deepak,

    I appreciate the update. Thanks.

    Patrick

  • Posted 28 May 2018, 7:41 pm EST

    Hi Patrick,

    This issue is accepted as a feature request for future version of SpreadJS and may get added soon.

    Thanks,

    Deepak Sharma

  • Posted 30 May 2018, 6:36 am EST

    Hi Deepak,

    That’s great to hear; thanks. For our planning purposes, do you have a rough timeline on when this might be implemented? Additionally, is there something I can monitor to track this progress, or do I need to look at the new releases as they come out to see if it’s included?

    Thanks,

    Patrick

  • Posted 30 May 2018, 2:34 pm EST

    Hi Patrick,

    We currently do not have an ETA for this request. As you said please keep a check on our release notes for every new build to know about the new features included.

    Thanks,

    Deepak Sharma

  • Posted 21 September 2018, 4:01 am EST

    Hi,

    I haven’t seen this implemented in any of the recent releases. Is this request planned for an upcoming release? If so, can I get a rough idea of when it might be ready? Are we talking weeks, months, etc.?

    Thank you!

    Patrick

  • Posted 23 September 2018, 10:30 pm EST

    Hi Patrick,

    This feature has not been implemented in any version yet, it is still with the development team. We will let you know once it is implemented.

    Thanks,

    Deepak Sharma

  • Posted 1 November 2018, 6:01 pm EST

    Hi Patrick,

    Our development team has provided a work around for now which you can use to overcome this issue. Please refer to attached sample where, custom cell is created adjusting the text as per the column width. Our development team will fix it permanently for our future build of SpreadJS.

    Thanks,

    Deepak Sharmanumber.html.zip

  • Posted 3 December 2018, 10:09 am EST

    Hi Deepak,

    As we are migrating to version 11, is this fix available in version 11 or 12?

  • Posted 3 December 2018, 9:38 pm EST

    Hello,

    This has not been fixed yet in V12 and hence you have to use the workaround provided by our executive Deepak earlier in the same thread.

    Thanks,

    Reeva

  • Posted 6 December 2018, 8:53 am EST - Updated 30 September 2022, 5:02 am EST

    Hello Reeva,

    I’m from the same team, and the work-around only partly meets our needs.

    The workaround only works when allowCellOverflow is set to false, and that effects the entire sheet (Both text, and numbers.) What we’re looking for is that only the number cells are effected as with in Excel.

    Excel

    The work around

  • Posted 7 December 2018, 12:03 am EST

    Hello,

    I have informed the development team about the same. I will let you know as soon as I get an update on it.

    Thanks,

    Deepak Sharma

  • Posted 14 December 2018, 3:03 am EST

    Hi Deepak,

    Any update?

  • Posted 16 December 2018, 5:49 pm EST

    Hello,

    I have not got any update on it yet. I have asked the development team for same. I will let you know as soon as I hear from them.

    Thanks,

    Deepak Sharma

  • Posted 9 January 2019, 3:25 am EST

    Hi Deepak,

    Any update?

  • Posted 9 January 2019, 9:34 pm EST

    Hello,

    This issue is with the development team. I am waiting for the ETA on this. I will let you know as soon as I get an update on it.

    Thanks,

    Deepak Sharma

Need extra support?

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

Learn More

Forum Channels