Summary: | BASIC, Format: Format (…, "Currency") cuts decimal places | ||
---|---|---|---|
Product: | LibreOffice | Reporter: | Robert Großkopf <robert> |
Component: | BASIC | Assignee: | Not Assigned <libreoffice-bugs> |
Status: | NEW --- | ||
Severity: | normal | CC: | buzea.bogdan |
Priority: | medium | ||
Version: | 7.6.2.1 release | ||
Hardware: | x86-64 (AMD64) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
Crash report or crash signature: | Regression By: | ||
Bug Depends on: | |||
Bug Blocks: | 124891 |
Description
Robert Großkopf
2023-11-06 16:47:13 UTC
Hello Robert I wouldn't expect Basic to follow localizations, just use the dot as a decimal separator. ``` SUB Formattest msgbox Format(123.546 ,"#,##0.00 €") END SUB The output of the msgbox is then localized (In reply to Werner Tietz from comment #1) > Hello Robert > > I wouldn't expect Basic to follow localizations, just use the dot as a > decimal separator. > > ``` > SUB Formattest > msgbox Format(123.546 ,"#,##0.00 €") > END SUB > > The output of the msgbox is then localized … but Format(123.546, "Currency") would run well in AOO (tested with AOO 4.1.8) and did run in the past with OpenOffice. So I thought it is intended to follow localization. Your code will run well, but doesn't follow the localization. Format(123.546, "Currency") will have a look at the localization (€-sign is set right) but will suppress decimal places. Hallo Robert seems locale-related?! If I switch the UI to **en-US** the Example works as expected: ``` SUB Formattest msgbox Format(123.546, "Currency") '############## '# 123,55 € '############## END SUB ``` Version: 7.6.2.1 (AARCH64) / LibreOffice Community Build ID: 56f7684011345957bbf33a7ee678afaf4d2ba333 CPU threads: 4; OS: Linux 6.1; UI render: default; VCL: gtk3 Locale: de-DE (de_DE.UTF-8); UI: en-US Flatpak Calc: threaded ``` LO 7.4.7.2 shows the same behaviour with UI: en-US →→ 123,55 € # ok! with UI: de-DE →→ 123 € # not ok! |