diff options
author | Steve Fanning <stevemfanning@yahoo.co.uk> | 2021-10-26 12:23:07 +0200 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@libreoffice.org> | 2021-10-27 01:04:38 +0200 |
commit | 7f8b84bbf7fda91426d01bab26b5fa0d148624a1 (patch) | |
tree | 9873e48709ca6fee9a696a55d79b5c4d8ab9cffc | |
parent | c94585cd933b70a844719985ea63f70928e6d365 (diff) |
Update help description of Calc’s TRUNC function.
The help description for Calc’s TRUNC function currently does not indicate that the Count argument is optional. However, the help description for the ROUNDDOWN function does show the Count argument as optional.
Since both user functions are implemented via one C++ function (ScRoundDown()), the optionality status of arguments should be the same for both functions. This was checked by confirming that the formulas =ROUNDDOWN(-45.67) and =TRUNC(-45.67) give the same return value (-45).
This change updates the optionality status of Count for the TRUNC function and provides the additional example given above.
Change-Id: I2078d068b870dd05f4c977a2f9909537ecf7f9ab
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/124190
Tested-by: Jenkins
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
-rw-r--r-- | source/text/scalc/01/04060106.xhp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/text/scalc/01/04060106.xhp b/source/text/scalc/01/04060106.xhp index f894aafd81..389cf9d237 100644 --- a/source/text/scalc/01/04060106.xhp +++ b/source/text/scalc/01/04060106.xhp @@ -618,7 +618,7 @@ <paragraph id="par_id3157866" role="paragraph" xml-lang="en-US"><ahelp hid="HID_FUNC_KUERZEN">Truncates a number by removing decimal places.</ahelp></paragraph> <embed href="text/scalc/01/common_func.xhp#sectionsyntax"/> -<paragraph id="par_id3148511" role="code" xml-lang="en-US">TRUNC(Number; Count)</paragraph> +<paragraph id="par_id3148511" role="code" xml-lang="en-US">TRUNC(Number[; Count])</paragraph> <paragraph id="par_id3150796" role="paragraph" xml-lang="en-US">Returns <emph>Number</emph> with at most <emph>Count</emph> decimal places. Excess decimal places are simply removed, irrespective of sign.</paragraph> <paragraph id="par_id3150816" role="paragraph" xml-lang="en-US"><item type="literal">TRUNC(Number; 0)</item> behaves as <item type="literal">INT(Number)</item> for positive numbers, but effectively rounds towards zero for negative numbers.</paragraph> <warning id="par_id3148548">The <emph>visible</emph> decimal places of the result are specified in <switchinline select="sys"><caseinline select="MAC">%PRODUCTNAME - Preferences @@ -627,6 +627,8 @@ <embed href="text/scalc/01/common_func.xhp#sectionexample"/> <paragraph id="par_id3152569" role="paragraph" xml-lang="en-US"><item type="input">=TRUNC(1.239;2)</item> returns 1.23. The 9 is lost.</paragraph> <paragraph id="par_id7050080" role="paragraph" xml-lang="en-US"><item type="input">=TRUNC(-1.234999;3)</item> returns -1.234. All the 9s are lost.</paragraph><comment>see also INT, ROUND, ROUNDDOWN, ROUNDUP, CEILING, FLOOR, EVEN, ODD, MROUND</comment> +<paragraph role="paragraph" id="par_id441635243969504"><input>=TRUNC(-45.67)</input> returns -45. The default value for <emph>Count</emph> is 0.</paragraph> +<tip id="par_id151635245092041">Refer to the <link href="https://wiki.documentfoundation.org/Documentation/Calc_Functions/TRUNC" name="TRUNC_Wiki">TRUNC</link> wiki page for more details about this function.</tip> </section> <section id="Section34"> |