Create a decimal field

Hello,

I want to create a decimal field for a document. I try “integer” but I can just write an integer … Then, I try “floating point” but even if I write “35.68”, it save “35.0”.

How can I do it ?

Thanks in advance for your help

0 votes

1 answers

1653 views

ANSWER

When you say "it saves", what do you mean? How are you setting this value? What widget type are you using if you're setting this via a form?
12/20/2012

In Studio, I creates a document type "XXX" with a field "Floating Point" (my_field).

Then I creates a new document "XXX" with my_field = 35.68 and I saves. I reload this document and in the field "my_field" there is 35.0 (instead of 35.68).

What is wrong ?

Thanks in advance

12/20/2012



I just tested, and had no issue. I guess since you started with an “int” type, the database was initialized to store an integer for this field. When changing it to a “floating point” after, i see the following error in logs:

ERROR [org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapper] SQL type mismatch for "FILE_SCHEMA"."MYINTOTBEFLOAT": expected 8, database has -5 / BIGINT (19)

So i guess you just need to drop your test database for this to be working as expected (or to alter the database column if you'd like to keep your current data)

0 votes



Thank you very much ! I altered the column and it works !
12/21/2012