https://bugs.kde.org/show_bug.cgi?id=406388

Mahmud Nabil <nabilsnig...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nabilsnig...@gmail.com

--- Comment #19 from Mahmud Nabil <nabilsnig...@gmail.com> ---
(In reply to Alexander Lohnau from comment #18)
> By making sure that no [ or ] character(used for vectors) is contained
> before replacing the string we make sure that we still provide all the
> features Qalculate does.
Hi, Qalaulate also offers a bunch of mathematical functions that accept
multiple arguments(e.g. integrate, perm, comb see
https://bugs.kde.org/show_bug.cgi?id=436933 for details). While qalculate
always accepts ';' as a argument separator, IMO it's more convenient for users
with locale which uses dot for decimal point to use ',' for argument separator.

The API reference for Calculator::calculate
http://qalculate.github.io/reference/classCalculator.html#a87b613af9c067971b3a45514677fb24f
suggests that
> The expression should be unlocalized first with unlocalizeExpression().
which seems do the same thing CalculatorRunner::userFriendlySubstitutions is
doing now. So I built the calculator runner with 
CalculatorRunner::userFriendlySubstitutions removed(when ENABLE_QALCULATE is
set) and changing the line that uses Calculator::calculate at
qalculate_engine.cpp to
```
MathStructure result =
CALCULATOR->calculate(CALCULATOR->unlocalizeExpression(ctext), eo);
```
this seems to produce the same result as the above patch with es_PE.UTF-8 as
well as not interfering with "argument separator commas" in en_US.UTF-8.

Is there any known issues or other reason that prevents the use of
CALCULATOR->unlocalizeExpression in this particular case?

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to