Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > Decimal Separator Problem View modes: 
User avatar
Member
Member
saul.munoz-gmail - 12/28/2010 1:24:14 PM
   
Decimal Separator Problem
Hi to all, where are trying to do a custom document type with decimal or float values, but when we add a new document or edit, the values with dot(.), is the decimal separator here in my country this dot(.) is removed from the field, is there a way to configure this or i need always to use comma(,) the format i´m want to show is

$ 3,000.50


Thanks in advance
Best regards And Merry Christmas!

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 12/29/2010 10:08:59 AM
   
RE:Decimal Separator Problem
Hi,

Which version of Kentico CMS are you using?

I tested behavior with 4.1 version and the field type was Decimal number (Double precision).
Input 3,000.50 was displayed as 3000.5 (in Form tab or in transformations).

To display this number in requested format, i.e 3,000.50 you could easily create a custom transformation function and reformat the number.

Best regards,
Ivana Tomanickova


User avatar
Member
Member
saul.munoz-gmail - 12/29/2010 10:29:30 AM
   
RE:Decimal Separator Problem
Hi Ivana,

My version is 4.1 Build: 4.1.3518.

My information is in Document Types a custom document with name swiss_product and i have 3 fields containing prices

Pricea Decimal Number (Double Precision) Field Type: TextBox
Priceb Decimal Number (Double Precision) Field Type: TextBox
Pricec Decimal Number (Double Precision) Field Type: TextBox

and i don´t know the reason, but when i put 300.50 it is saved in db as 30050
but if i put in 300,500 it is saved as 300.50 in db.

I hope you understand my bad english hihi!!

Best Regards,
Saul Munoz

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 12/29/2010 1:34:14 PM
   
RE:Decimal Separator Problem
Hi,

the decimal number is formatted based on used culture (using namespace System.Globalization). You are probably using one of following cultures.

You have two options:
1. change Preferred user interface culture in Site Manager - Administration - Users (for example to English).
2. create a custom form control using example code from above forum.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
saul.munoz-gmail - 12/29/2010 1:48:30 PM
   
RE:Decimal Separator Problem
Hi, Ivana thanks for your answer im trying the custom form, cause the culture is correct in the site, and in the users

Thanks in advance

Best regards,
Saul Munoz