Issue 85656

Summary: implement formula function "mround" as in Calc
Product: Writer Reporter: modir <modir>
Component: editingAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: issues, kpalagin, rb.henschel
Version: OOo 2.3Keywords: oooqa
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Latest Confirmation in: ---
Developer Difficulty: ---

Description modir 2008-01-29 01:20:09 UTC
I wrote the following formula into my Writer document:


Instead of 2.5 (as in Calc) I got 0.5 as the result. In fact I checked with
several different entries and this function always prints the second parameter.
Comment 1 kpalagin 2008-01-31 14:50:30 UTC
Using m241 on WinXP - as described.
Comment 2 Regina Henschel 2008-01-31 15:56:36 UTC
As far as I know there is no function mround in Writer. Writer has only got a
function ROUND with the syntax:

          number to be rounded ROUND how many decimals

So you have to write for example

          3.141523 ROUND 2

for to get 3.14

You can see all available functions if you start the formula bar with F2 and
then click on the f(x)-button.

You will find more about Writer formulas in the Writer-chapter 'Formula' in the
application help. You reach this chapter when you search for 'pow' in the
Writer-part of the help or using the index with the path formula > calculating
in text > Related topics Formular Bar > Formula
Comment 3 modir 2008-01-31 17:05:42 UTC
I would like to reopen this bug for the following reasons:

1) mround() and round() have two different purpose. With mround() you can round
to the next multiple of the second parameter. This function is especially useful
if you are working with money where you have to round to 0.05, 0.10, 0.15 etc...

2) This formula was accepted by the formula bar. So this means that it is
somehow known (Probably because it is implemented in Calc)

Therefore I would like to re-open this bug report as either
a) a feature request (to implement this formula)


b) a bug report because the formula bar is accepting a formula it shouldn't


c) if it should exist, as a bug report to put this formula into the drop-down
menu and document it in the documentation. (Together with fixing the bug)

I don't know how it should be.
Comment 4 Regina Henschel 2008-01-31 17:48:37 UTC
mround() and round() are Calc-functions and not available in Writer. In Writer
the arguments of a function is never enclosed in brackets as it is in Calc.

for 2)
Writer does not accept a function 'mround()' but treads 'mround' as a field
variable. Because variables can be used in formulas, Writer accepts it. It will
also accept 'blackbird(sun;garden)' for example.

I don't know too, for what purpose writer accepts input that is no valid
calculation term.

Comment 5 modir 2008-02-03 17:23:35 UTC
OK. I changed the Issue type to "feature request". I would like to have the
function mround with the following syntax:

2.3 MROUND 0.5

number to be rounded MROUND the multiple

Although the problem why it got accepted is there as well. But I think it is
probably too hard to solve this fully.
Comment 6 michael.ruess 2008-02-04 08:45:42 UTC
Reassigned to "requirements".