cancel
Showing results for 
Search instead for 
Did you mean: 

Data type for price

meistereder
Champ in-the-making
Champ in-the-making
Hi,

I want to add a new property to my model. The new property is a price such as 129.00
what is the best data type for that. Normally, I use BigDecimal but this is not supported.
Is it better to user d:text with some regex, d:float or to implement a new data type?
When implementing the new data type what are the steps?

Best regards,
Florian
4 REPLIES 4

alexey
Champ in-the-making
Champ in-the-making
Did you see the article?

meistereder
Champ in-the-making
Champ in-the-making
Yes, I have read this artikel. But there is no information for creating a new data type (or I missed something).
May be there is another solution to handle a price in meta-data.

billerby
Champ on-the-rise
Champ on-the-rise
I also need to have a data-type that can handle prices. I can't find any guide on how to create a custom data type. Is there one?

iblanco
Confirmed Champ
Confirmed Champ
I also need it and find it very strange that it is not already present a data type similar to Javas BigDecimal.

I commented my different approaches to solving this in this post.