Apache OpenOffice (AOO) Bugzilla – Issue 35530
Openoffice truncate numeric-values
Last modified: 2013-08-07 15:45:41 UTC
Hello, i use openoffice 1.1.2, unixodbc 2.2.4, postgresql 7.4.3 with Debian Linux (on i386). All with german locales. With this i use tables and macros, over odbc-connection, and make an access to postgresql-database. The enviroment LANG is set to "de_DE@euro". This is correct. Openoffice use this. This all works fine. But Database-Values of type numeric (same as decimal) are displayed truncated. Openoffice show a value of 5,55 as 5,00 ("," not "." in german!) An Example In psql, The Postgresql-Database-Shell: CREATE TABLE tktest( intfeld integer, realfeld real, numericfeld numeric, numeric2feld numeric(9,2)}; INSERT INTO tktest(intfeld, realfeld, numericfeld, numeric2feld) VALUES(555, 5.55, 5.55, 5.55); select * from tktest; intfeld | realfeld | numericfeld | numeric2feld ---------+----------+-------------+-------------- 555 | 5.55 | 5.55 | 5.55 This is OK. In isql, The ODBC-Database-Shell: select * from tktest; +------------+--------------+-------------+-------------+ | intfeld | realfeld | numericfeld | numeric2feld| +------------+--------------+-------------+-------------+ | 555 | 5.5500002 | 5.55 | 5.55 | +------------+--------------+-------------+-------------+ This is OK. (I known, why i dont want to use real-types). And now i open the Databasebeamer of Openoffice with Hotkey F4. intfeld realfeld numericfeld numeric2feld 555 5,55 5,000000 5,00 Where is the "5,55" in numeric? Why this display 5,00? All vars in forms, they use this Values, display the same wrong content. The displayformat have no effect to this. - If i use a macro and calculate with this values, then are the calculate value are correct. - If i copy the Database to a calc-document, then all values are correct. - If i set the enviroment LANG to a unvalid value like "de_de@blablabla", then then all values are correct. But this is agly for the rest of the system. - If i unset the enviroment LANG, then all values are correct. But this provide openoffice to use the english language. Not usefull in germany. I read in the german openoffice-user-list, the same problem exists with mysql. Im think, this is a error of Openoffice? bye Thomas
Hi, I can reproduce this. I send it to the right developer. Bye Marc
I'd say this should be "OOo 2.0" then, as it sounds pretty serious.
Set to dba
Here it comes. In short it is a problem of SQLGetData for Numeric columns. The value is always localized. "5.55" -> "5,55" for a german locale. I found the link below which describes excatly the same behavior for MyODBC. >> The problem is that the SQL standard requires numbers to have '.' and >> not ','. http://lists.mysql.com/myodbc/165 So should SQLGetData avoid to localize it's data?
Yes, with MYODBC it is the same. But when i change the locale of 'LC_NUMERIC=de_DE' it works fine. Only the locale 'LC_NUMERIC=de_DE@euro' works wrong.
I have fond a mistake. In one of my table i have a 'formattet field' and this work fine and an other 'numeric field' and this work wrong. So I change the 'numeric field' to a 'formattet field' and OO.o works fine. And so I am thing in german we shall use the 'formattet field' or?
Hi Frank, Ocke, as Martin pointed out on the releases list we are coming closer to 2.0 Beta. http://www.openoffice.org/servlets/ReadMsg?list=releases&msgNo=8258 Is your work making progress and would be ready for 2.0 as the target milestone indicates? Thanks, Stefan
This is a problem external to OpenOffice.org, which cannot be solved in OOo.
Hallo Frank Is it really an "external" problem - we do have the same problem with localized versions of oo.o for the windows-world, didn't we. martin
I remember we did have such problems, but don't find the issue. Do you have it? For this particular issue here, Ocke traced it down to the ODBC driver returning data in a non-conformant way, there is not really much we can do about this on OOo side (except perhaps some guessing and magic, but I would not really want to introduce such hacks).