vaadin / spreadsheet

Spreadsheet for Vaadin Framework
Other
46 stars 55 forks source link

Spreadsheet: General-type cells should round long numbers #263

Closed vaadin-bot closed 9 years ago

vaadin-bot commented 9 years ago

Originally by @Ansku


If you create an Excel sheet and put number 12345.6789199999 into a General type cell, it gets rounded to 12345.67892. Spreadsheet doesn't do such rounding, so if the column width has been set in Excel according to the contents they won't fit in Spreadsheet and display only ###. However, 1234.56789199999 does get rounded to 1234.567892 just like in Excel.


Imported from https://dev.vaadin.com/ issue #18175

vaadin-bot commented 9 years ago

Originally by @Ansku


Attachment added: general_round.xlsx (9.3 KiB)

vaadin-bot commented 9 years ago

Originally by cesarecantieri


Some extra important specifications were discussed here https://vaadin.com/pro/support#870:

//From our point of view ellipsis and tooltip is a proper solution just when rendering strings and the space is not enough. In Excel, decimal numbers, with at least 10 digits, are always rounded at the tenth digit (10 may vary with Excel version). Reducing the column width, they are incrementally rounded according to the cell narrower dimension, then only when the available space is no more enough even to show the integer part a sequence of "#" is showed. In our opinion this is the way Spreadsheet should do. No matter about the 10, the important thing is the incremental rounding of decimal part instead of immediately showing the "#" sequence as the Spreadsheet actually does.

//Sounds reasonable, this way we can keep the current rounding default and only change the behaviour when there are visibility problems

vaadin-bot commented 9 years ago

Originally by @Ansku


https://dev.vaadin.com/review/11523

vaadin-bot commented 9 years ago

Originally by @alvarezguille


New patch, only server side changes https://dev.vaadin.com/review/#/c/11606/