Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

DECIMAL table field not correclty created in DB 31 Jan 2013 07:46 #6579

BUILDER: if I create a field DECIMAL and then in the validation rule I make for example a rule to have a value like:

decimal (11, 7)

the validation rule works perfectly, BUT the value is not stored correctly in the DB, because the SQL code to create that field at the installation process of the component, is wrong.
It still create a field:

decimal (10, 2)

Please Log in or Create an account to join the conversation.

Re: DECIMAL table field not correclty created in DB 31 Jan 2013 09:07 #6585

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
When you create the decimal field type, are you also adding in the precision and scale to the field properties on the table?

I've done this with no problem at all previously with height, width, price and percentage type data combined with a custom regex validation too.

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

Please Log in or Create an account to join the conversation.

Re: DECIMAL table field not correclty created in DB 31 Jan 2013 10:26 #6587

Hi, thanks for the reply.
where should be the option?, I didn't find it any other options except these:

Please Log in or Create an account to join the conversation.

Re: DECIMAL table field not correclty created in DB 31 Jan 2013 12:11 #6590

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
Hi @Tomaselli,

When you add the field to the table, select the decimal data type then you'll see precision/scale input properties on the field underneath the required, unique etc...

Then, when you type into precision/scale, a rule/handler will be created. You can and probably should override the handler and regex with your custom validation.

Hope it helps,

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
The following user(s) said Thank You: Tomaselli

Please Log in or Create an account to join the conversation.

Re: DECIMAL table field not correclty created in DB 31 Jan 2013 12:23 #6595

thanks, I found it, the problem was because I created the table field from the FLOAT instead to use the DECIMAL, even if at the end....the final field table type it's the same.

Please Log in or Create an account to join the conversation.

Re: DECIMAL table field not correclty created in DB 31 Jan 2013 12:31 #6596

but it shouldn't be like that.

Please Log in or Create an account to join the conversation.

Re: DECIMAL table field not correclty created in DB 31 Jan 2013 12:41 #6597

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195

Tomaselli wrote: but it shouldn't be like that.

what do you mean - that it shouldn't be storing it as a float when decimal fieldtype is set?
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

Please Log in or Create an account to join the conversation.

Re: DECIMAL table field not correclty created in DB 31 Jan 2013 13:48 #6598

At the beginning I selected a FLOAT type, then I modify the validation rule, to work as a decimal (11, 7).
I saw on the SQL file generated, it was generated a decimal (10,2), so I thought the jcook builder recognized my will :) and it generated a decimal field, but the precision, scale was wrong.

So I made the post.

Then you pointed me to the fact I did a mistake chosing the FLOAT, but I should have choosen a DECIMAL type, otherwise the precision, scale options will not appear.

so my thoughts are:

1) if the jcook generated a decimal field instead of the initial float field, why didn't jcook generate a correct precision, scale (decimal(11,7))?

2) IF jcook wasn't supposted to generate a decimal field from an initially choosen FLOAT field type, why did it generate a decimal?


I hope my explanation is enough understandable. :)

I found out, it was my mistake! :-) the Jcook is working correctly on the table field creation. I just exchanged the files I was comparing. I apologize.

The following user(s) said Thank You: JoomGuy

Please Log in or Create an account to join the conversation.

Last edit: by Tomaselli. Reason: I added some notes, to avoid confusion to the jcook community

Re: DECIMAL table field not correclty created in DB 31 Jan 2013 21:19 #6601

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
Hi @Tomaselli,
Don't apologise! All feedback - whether they turn out to be issues, or not - are really helpful in identifying areas of the ever-evolving interface that could be further explained and/or documented.

As always, your input is always valued!

Thanks,

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.071 seconds

Real time saver and great Component Builder tool ! I have been developing with J-Cook Pro Component Builder for several months now and can say with all honesty that this product/service is second to none. The product is feature rich and is being improved and added to all the time. Do yourself a favor if you need to build a Joomla! Component then you can do no wrong in trying the product. You will save on time and effort while being able to deliver your project on time. J-Cook pro does the hard work for you you then have the freedom to fully customise the end result for your own needs. 

One word: Awesome.
Edwardcox (JED)
         

Get Started