[Libreoffice-bugs] [Bug 123878] New: Numeric format inconsistency: Macros vs Writer fields, formula calculation fails
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Tue Mar 5 15:50:40 UTC 2019
https://bugs.documentfoundation.org/show_bug.cgi?id=123878
Bug ID: 123878
Summary: Numeric format inconsistency: Macros vs Writer fields,
formula calculation fails
Product: LibreOffice
Version: 6.2.0.3 release
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: Extensions
Assignee: libreoffice-bugs at lists.freedesktop.org
Reporter: jsd.libreoffice at bvac.co.za
[Sorry if Extensions component is wrong, wasn't sure what to pick]
Running LO 6.2.0.3 on MacOS 10.13.6 in South Africa, where system regional
setting uses comma rather than period for decimal separator.
Writer treats strings with period, eg "1.5" as non-numeric and evaluates that
as 0. With a comma instead, eg "1,5" the value is one-and-a half. OK, fair
enough.
Now I have a macro that extracts a value from a spreadsheet cell, and sets that
value into a Writer variable field which is then used elsewhere in a Writer
formula.
The latter formula does not compute correctly - result is 0 - because the
extracted spreadsheet value (a floating point number, type Variant/Double
returned by RangeTLCellValue) gets turned into a string with a period for
decimal point in the Writer variable field (DependentTextField.Content =
myNumericValue)
Either the implicit double-to-string conversion should be using the same
punctuation that's expected elsewhere (so comma not period) or else everything
should accept a period as decimal separator in number strings, and then do the
local-dependent presentation only at the formatting stage (which is what
OpenOffice used to do: this macro began life there).
FWIW I tried changing Language settings in the document, made no difference.
Presumably the system locale trumps that for number parsing. This also
affected static "set variable" fields in the template: I had to change decimal
periods to commas in those too, to make the formulas work.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20190305/bfee1077/attachment.html>
More information about the Libreoffice-bugs
mailing list