I try to use the number format #.# to display 7 as 7, but it does display "7." (in Excel, or other MS environment)
I want 7.1
to be 7.1
, and 7
to be 7
, and 7.49
to be 7.5
, that is #.#
(see here)
I can't use formulas in that cell, because user will edit it, I can only work with custom formatting of the cell.
Is there a way to display a number without insignificant zeroes, but eventually with one decimal place if there is something after the decimal separator?
As the format #.###
means, 7
for 7
, in that case Excel does not render the value properly, this should be considered a bug, and fixed by Microsoft. Here bellow a .Net sample with the #.#
number format displaying correctly 123
as 123
(without the dot).
https://dotnetfiddle.net/JDBLM2
My question is because I try to format in a Excel-like (telerik) spreadsheet, numbers, something like
sheet.range("C11:Z100").format('[>=1]#;[<1]#.####');
but there is not a such formatting condition for integers, like:
sheet.range("C11:Z100").format('[=INT(C11)=C11]#;[=INT(C11)<>C11]#.####');
I can't use VBA, because I have the spreadsheet only, I work on a web application containing spreadsheet, and I have no VBA, I have only C# server side code, and JavaScript on the client side.