Ask Your Question

why basic code ''ThisComponent.getCurrentSelection.formula" replaces comma with semicolon? [closed]

asked 2013-05-21 19:27:43 +0100

Kunjomachen gravatar image

updated 2013-05-22 01:23:29 +0100

oweng gravatar image

my current cell's formula is "=SUM(F4,F6)" and the result of basic code "ThisComponent.getCurrentSelection.formula" is "=SUM(F4;F6)". why comma is replaced with semicolon?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2015-11-01 14:06:18.423068

1 Answer

Sort by » oldest newest most voted

answered 2013-05-21 21:00:52 +0100

mahfiaz gravatar image

updated 2013-05-21 21:01:40 +0100

In quite a number of languages other than English decimal points are separated with comma, such as 0,5 (stands for English 0.5). Now imagine you want to write a similar equation to sum 0,4 and 0,6, but writing =SUM(0,4, 0,6) would give you 10 instead of 1. Therefore localized LibreOffice uses different argument separators inside functions.

So the two following equations are exact equivalents:

=SUM(0.4, 0.6)
=SUM(0,4; 0,6)
edit flag offensive delete link more


So, is there any way to return the basic code's result based on the localized argument separator?

Kunjomachen gravatar imageKunjomachen ( 2013-05-22 18:16:44 +0100 )edit

The easiest way is to switch your locale to English, see Tools → Settings → Language settings and also Tools → Settings → Calc → Formula → Separators.

The "right" way would be to make your code work with both notations, see

and also

mahfiaz gravatar imagemahfiaz ( 2013-05-22 20:34:31 +0100 )edit

Question Tools


Asked: 2013-05-21 19:27:43 +0100

Seen: 824 times

Last updated: May 21 '13