Search code examples
sqlexcellibreoffice-calc

How do percentages get calculated in LibreOffice?


Cell A1 contains value 0.974, and cell A2 contains formula =A1.

Formatting for cell A1 is a number like -1234.123, and formatting for cell A2 is a percent like -12.95%.

The result shown in A2 is 97.35%.

How is that being calculated? And how do I convert that calculation to SQL?


Solution

  • I'm guessing that the actual value of cell A1 is something like 0.9735. You can see the actual value by selecting the cell and looking in the formula bar. Then it shows 0.974 when formatted to 3 decimal places, and cell A2 shows 97.35% as you said.

    It sounds like it is simply rounding the value in cell A1 to the nearest 3 decimal places. To do this in SQL, use the ROUND function.