45 Posts
Jan
10 years ago
5
Topic

My admin form and site form (Joomla v3.3.3 and Seblod v3.3.6) contain a field 'price'. This field is a Text field with format Var50. Input and display of numbers is like 123.456.789,00. Everything worked well until I installed the plugin Search Ordering. The ordering jumped from 100,99 to 11 and not to 101,00. So I changed the format from Var50 into Decimal(10,2). After that, ordering is what it should be, but numbers are displayed like 123,456,789.00, input the same. Installing language Dutch in Joomla and Seblod, neither language overrides changed the way numbers are displayed. I have searched everything I could without success. How to change the way numbers are displayed in Seblod forms? Who knows?

Get a Book for SEBLOD
178 Posts
Jeka
10 years ago
2
Level 1

Hi.

Maybe you can save numbers in flat format in some table and use core42 filed with number_format function to make numbers look like you want and render it also with this field. 

693 Posts
rpoy
10 years ago
1
Level 2

Hi,

For forms, you need something like a mask. For the different languages, you can use the Language field to show/hide different fields for different formats.  Another option is to use the Code Pack to call a javascript code which formats the number.

hope that helps,

Randy

45 Posts
Jan
10 years ago
0
Level 3

Hi Randy,

Thanks for your reply, unfortunately it does not help me.
The plugin mask validates the input, it does not change a ',' in a '.' before storage of the input in the table and it does not change a '.' in a ',' on displaying the stored decimal in my list. Before I can use the Language field to show the right field and hide the wrong one, I must have the field with the right format, but that is the question.
My list must be ordered by 'price' and therefore 'price' must be a decimal. I am disappointed in Seblod's handling of decimals. It is to basic for an extra plugin like Code Pack.

45 Posts
Jan
10 years ago
1
Level 1

Meanwhile, I have found a solution for the display of the feld 'price' in the list form. In my template a have changed 

<? Php echo $ cck_renderFiled ('price');> to 

<php echo number_format ($ CCK?> GetValue (prijs_eb), 2, ",", ".");? >. 

For my list, it's this. For now I still need something for the input in the admin form.

45 Posts
Jan
10 years ago
0
Level 2

Sorry, 'prijs_eb' must be 'price'.

Get a Book for SEBLOD