Bug 145332

Summary: Consider updating Calc help for ROUNDDOWN and TRUNC functions
Product: LibreOffice Reporter: Steve Fanning <stevemfanning.wh>
Component: DocumentationAssignee: Rafael Lima <rafael.palma.lima>
Status: RESOLVED FIXED    
Severity: normal CC: 79045_79045, olivier.hallot, rafael.palma.lima
Priority: medium    
Version: 7.3.0.0 alpha0+   
Hardware: All   
OS: All   
Whiteboard: target:7.4.0 target:7.6.0
Crash report or crash signature: Regression By:
Attachments: Sample ODS file
Exported XLSX file

Description Steve Fanning 2021-10-26 20:25:48 UTC
Description:
The ROUNDDOWN and TRUNC functions in Calc perform exactly the same function (implemented by C++ function ScRoundDown()).

However this is not apparent from the help, which provides independent and (perhaps more importantly) different descriptions of the two.

When time allows, suggest reviewing the help information for these two funtions with a view to achieving greater consistency in wording across them.

Steps to Reproduce:
Read help descriptions for ROUNDDOWN and TRUNC functions.

Actual Results:
Different wording for two functions that perform exactly the same function.

Expected Results:
Consistent wording for two functions that perform exactly the same function.


Reproducible: Always


User Profile Reset: No



Additional Info:
Viewed latest 7.3 online help.
Comment 1 Rafael Lima 2021-11-26 20:47:10 UTC
They're both documented in the same help page:

https://helponline.libreoffice.org/7.3/en-US/text/scalc/01/04060106.html?DbPAR=CALC#bm_id3145991

Fun-fact, in MS Excel ROUNDDOWN and TRUNC have one minor difference: in ROUNDDOWN the argument Num_digits is mandatory, whereas in TRUNC it is optional.

See this discussion:
https://www.mrexcel.com/board/threads/trunc-vs-rounddown.1066382/

However, in LO Calc the argument is optional in both functions.
Comment 2 Rafael Lima 2022-01-11 18:36:59 UTC
Created attachment 177464 [details]
Sample ODS file

Another interesting finding. I created an ODS file using both ROUNDDOWN and TRUNC functions (see attached ODS file) without using the Count argument.

When I exported the file as XLSX (from LibreOffice), it automatically added the Count = 0 to ROUNDDOWN to ensure MS compatibility.
Comment 3 Rafael Lima 2022-01-11 18:37:23 UTC
Created attachment 177465 [details]
Exported XLSX file
Comment 4 Rafael Lima 2022-01-11 20:02:00 UTC
Patch available for review at:
https://gerrit.libreoffice.org/c/help/+/128244
Comment 5 Commit Notification 2022-01-18 23:10:44 UTC
Rafael Lima committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/6b1075e1e032be5bb6cba1dbdcc11de2a1824add

tdf#145332 Improve help pages for TRUNC and ROUNDDOWN
Comment 6 Commit Notification 2023-03-14 14:57:16 UTC
Rafael Lima committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/36f71cb8d29fde0c8b42238ba59bc1d73b042cc6

Related tdf#145332 Fix sentence about TRUNC function