Bug 104903 - Firebird: Function ROUND gives wrong values
Summary: Firebird: Function ROUND gives wrong values
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
5.3.0.0.alpha0+
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-24 08:38 UTC by Robert Großkopf
Modified: 2017-02-02 17:50 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Open the query round - seems the decimal places were lost. (3.60 KB, application/vnd.oasis.opendocument.database)
2016-12-24 08:38 UTC, Robert Großkopf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2016-12-24 08:38:53 UTC
Created attachment 129915 [details]
Open the query round - seems the decimal places were lost.

Open the attached Firebird 3.0 database.
Open the query Round.
Gives wrong values here, ignores the decimalpoint.

Query
SELECT "ID", 7.314 "7.314", ROUND( 7.324, 2 ) "ROUND(7.324, 2)" FROM "Table1"

Shows
1 | 7314 | 7320

ROUND works right with decimal and numeric fields, but doesn't work right with direct input. Seems to be something wrong with writing decimal places here at all, see '7314' instead of '7.314'. The value has been rounded right, but it is displayed wrong.

Version: 5.4.0.0.alpha0+
Build ID: 2a4cd80abcf9e515d1ce3b3a944b573bdc42bff2
CPU Threads: 4; OS Version: Linux 4.1; UI Render: default; VCL: kde4; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-12-22_00:18:04
Locale: de-DE (de_DE.UTF-8); Calc: group
Comment 1 Buovjaga 2017-01-01 20:48:10 UTC
Confirmed.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.4.0.0.alpha0+
Build ID: fc0d4e6bc43d5f982452df07930f5ecf5927ad22
CPU Threads: 8; OS Version: Linux 4.8; UI Render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on December 31st 2016
Comment 2 Robert Großkopf 2017-01-25 20:30:43 UTC
Testing this again with Casting the type of the direct inputted value:

SELECT "ID", CAST(7.35 AS NUMERIC(4,2)) "7.35", ROUND(  CAST(7.35 AS NUMERIC(4,2)), 1 ) "ROUND(7.35, 1)" FROM "Table"

will show the right values. Have changed the values of the field, because the GUI will only show 2 digits by default.
Comment 3 Robert Großkopf 2017-01-25 20:31:32 UTC
Changed the version to the first LO 5.3, because the bug has been introduced with new Firebird 3.0.
Comment 4 Robert Großkopf 2017-02-02 17:50:36 UTC
This one has been fixed by fix of
https://bugs.documentfoundation.org/show_bug.cgi?id=105101