Developer forum

Forum » Development » Decimal field is rounded for code first itemtype

Decimal field is rounded for code first itemtype

Jesse Bakker
Reply

Hi,

We've got a codefirst paragraph itemtype with a decimal field created as followed:

[Group("Algemeen")]
[Name("Score")]
[Decimal]
public decimal Score { get; set; }

But the value isn't saved as decimal. It keeps getting rouded to the closest whole number when saved. 

Tried it with another codefirst itemtype but shows same behaviour. Then tried it with itemtype created in the backend this is working fine.

The solution is running on version 8.8.1.6.

Thanks for your help.

BR Jesse


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Can you try a Double?

I'll have this investigated.

Votes for this answer: 1
 
Jesse Bakker
Reply

Thanks Nicolai, that did the trick.

 

You must be logged in to post in the forum