[Solved] Replace all dots with commas for Swedish data

Discuss the spreadsheet application
Locked
endian
Posts: 1
Joined: Mon May 19, 2025 9:42 pm

[Solved] Replace all dots with commas for Swedish data

Post by endian »

Hi,

In Sweden someone decided a long time ago that we should use a dot instead of a comma as the decimal point.

This of course creates some challenges when it comes to dealing with numbers in spreadsheets.

Workarounds has however been found during the decades. When using Microsoft Excel it is quite easy, for example, to just set up search - replace to replace all dots '.' with commas ',' in columns full of decimal values (for example costs).

This does not seem to work in OpenOffice however.

Is this a known problem that you plan to fix?

/ Kenneth
Last edited by MrProgrammer on Mon Jun 02, 2025 3:29 pm, edited 1 time in total.
OpenOffice 4.1.15 Windows 11 Pro
User avatar
Hagar Delest
Moderator
Posts: 33357
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Search / replace needs work

Post by Hagar Delest »

Hi and welcome to the forum!

We don't fix anything since we are only users like you here. Devs can be contact through the mailing list only.

What have you tried for search and replace? If you replace the dot with the coma, make sure the option for regular expression is not checked.
There are plenty of topics in the forum about issues with the decimal separator.
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE Faye) and 24.8 portable on Windows 11.
User avatar
MrProgrammer
Moderator
Posts: 5264
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Search / replace needs work

Post by MrProgrammer »

endian wrote: Mon May 19, 2025 9:49 pm Workarounds has however been found during the decades
OpenOffice does not need workarounds. It supports both:
• Decimal point = Period, Thousands separator = Comma
• Decimal point = Comma, Thousands separator = Period

You control how OpenOffice displays and interprets numbers through the locale. (OpenOffice sometimes calls it Language in some dialogs.) If I put formula =PI() in a cell, setting Format → Cells → Numbers → Language to English (Canada) for the cell (or the equivalent setting in a style) displays the value as 3.141593 (period as decimal separator). Setting Format → Cells → Numbers → Language to French (France) displays the same value as 3,141593 (comma as decimal separator).

The locale also controls the display and interpretation of dates and times. If I type 4/7 in a cell formatted with Language → English (Canada) this is interpreted as meaning April 7 of the current year, which in 2025 is Monday. If I type 4/7 in a cell formatted with Language → French (France) this is interpreted as meaning July 4 of the current year, which in 2025 is Friday. Setting the correct locale in OpenOffice is very important.

You can import data to Calc in either comma/period convention. Just set the correct Language for the import in the Text Import dialog. If data was incorrectly imported with the wrong locale, it can be fixed with the Text to Columns feature. I would use the Find and Replace dialog as a last resort to correct data problems due to improper locale settings. Read about the locale in Calc using F1 → OpenOffice Calc → Find → Search term → locale → Find. Especially read:
• Cells in Currency Format
• Converting Text to Numbers
• Text Import
• Languages
• Language Setting Options
[Tutorial] Ten concepts that every Calc user should know
[Tutorial] Text to Columns


endian wrote: Mon May 19, 2025 9:49 pm This does not seem to work in OpenOffice however.
I am able to change period to comma and vice versa using the Edit → Find & Replace dialog.

"It didn't work" isn't helpful in the forum because it tells us what did not happen. Please never use that phrase in a post. We need to know exactly what actions you took, what did happen, and what you expected to happen. Attaching a document demonstrating the problem is almost always helpful for us and will get your problem solved more quickly. For example, if you typed a formula, pressed Enter, and got #VALUE!, tell us that, not "It didn't work." Then attach your document so we can see what's wrong. Often "it didn't work" means "it didn't do what I expected" and the real problem is that the program is behaving correctly but your expectations are incorrect. To help you solve the problem we need to know your expectations and your ultimate goal.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.5, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
Locked