Developer forum

Forum » Ecommerce - Standard features » GetDouble has issues with culture

GetDouble has issues with culture

Claus Kølbæk
Claus Kølbæk
Reply

Hey

In a paragraph template i am getting a value from an item field with Model.Item.GetDouble("..) and it seems to try and return it in danish culture if I am using that for dw.

As this image shows GetString returns the it with a decimal seperator of ',' and the GetDouble simply just rounds off and returns 962:

Now I ofc. have a simple way of making a workaround, but it seems it needs a fix :)

 

- (Oh, this should not have been in the ecommerce part of the forum, feel free to move it).


Replies

 
Oleg Rodionov Dynamicweb Employee
Oleg Rodionov
Reply

Hi Claus,

The issue is now bugged by DevOps item 921 submitted. Thanks.

BR, Oleg QA

 
Claus Kølbæk
Claus Kølbæk
Reply

Hi Oleg

While you are at it, would it maybe also be possible for the Decimal itemtype to take more than 2 trailing numbers? I am not sure why there is a backend limitation on this.

 
Nicolai Pedersen
Reply

Hi Claus

The Decimal item field type is very old - from before input type=number and has a ton of js.

You can switch to the html5 editor type and then choose number. Then you get a browser native implementation instead:

 

You must be logged in to post in the forum