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

TOPIC:

Decimals 26 Jan 2012 06:55 #1090

  • tr4ding
  • tr4ding's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 42
  • Thank you received: 0
By the way.....on a "latitude" field, i choose a custom validation for my float type with an handler "float_10_6" and a regular expression "^\d{0,4}(\.\d{0,6})?$".....

If i insert a "correct value", such as 38.111534, it's truncated in the last 2 digits and it appears as "38.1115".....what am i missing?

Thank you in advance for your strong support....

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

Re: Decimals 26 Jan 2012 11:03 #1093

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
The problem is not about regex.
I quite sure you can submit the form without validator alert.

Look in your database :
The format sould be DECIMAL(8, 2)

DECIMAL(precision, scale)
pecision is the TOTAL number of digits.
scale is how many digits before the '.' (units)

I think this is your problem. Your regex seems fine.
Coding is now a piece of cake

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

Re: Decimals 26 Jan 2012 11:07 #1095

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Oh, excuse me I checked your project.

You are using floats.
Try to use decimal format and configure DECIMAL(8,2) in the poperties. (Precision/scale)
Coding is now a piece of cake
The following user(s) said Thank You: tr4ding

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

Re: Decimals 26 Jan 2012 14:57 #1102

  • tr4ding
  • tr4ding's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 42
  • Thank you received: 0
Thank you!!!! Works fine!!!! I appreciate a lot!!!

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

Last edit: by tr4ding.
  • Page:
  • 1
Time to create page: 0.118 seconds

I jumped and started to work on a demo component... but 2 days later this demo component became the real component. I just showed today the end result to my customer and he turned to me and said... "this is more than I expected"... All of this is because Cook did cut about 70% of my work and provided me more ways to improve the usability of the component. The end result was 17 tables all related between than to generate a full dashboard for the travel agents. Thanks for Cook developers for such great tool. This component would not be possible to be done at short time with all the features in it
Griiettner (Forum)  

Get Started