How to create a precise decimal field (for amounts of currency)


I want to create a field to store a precise value (like a monetary value, for example), so I don't want to use floating point formats like double. But I've seen that in schema, the only two decimal types I can create are xs:decimal and xs:double, which, according to , are stored both as double.

I would like to use something like BigDecimal, because I'm afraid to lose the real value that the user wanted to store.

Is it possible to add something like this? If not, what is the way to go, storing as a String with validators? I've seen that in a question ( ), but it is a bit old and I don't know if now there is another solution.

Thank you very much in advance,

0 votes

1 answers



There's no decimal type in Nuxeo at the moment. You can follow NXP-12071 to get notified if work on this gets scheduled. No customer has yet requested this kind of feature.

As a workaround you can use a String like suggested in the question you link to, or you can use an integer with an implied scale factor to represent your decimals.

1 votes

Thanks, Florent!

I will use a String with validators.

Kind regards,