Decimal Points?

jparr021 30 Nov, 2007
Hey,
I was just wondering why my forms will not let me enter decimal points? Is this a chronoforms issue, or a database issue? I tried to enter the number 2.5 into my form which works, when I use regular integers without decimal places. Any ideas?
GreyHead 30 Nov, 2007
Hi Jeff,

You probably need a decimal field in the database, ChronoForms only offers Integer field types so this will need a bit of hand tweaking.

Bob
jparr021 04 Dec, 2007
Hand tweaking of the code, or in the database? Because I did try change the database of the hours field to a decimal field and it did not seem to work.
GreyHead 04 Dec, 2007
Hi Jeff,

I was thinking of the database, probably needs something like a DECIMAL[6,2] i.e. 9999.99 max. As an alternative you could tweak the code to multiply the submission by 100, store as an integer and divide by 100 when you display.

Bob<br><br>Post edited by: GreyHead, at: 2007/12/04 17:34
jparr021 04 Dec, 2007
Wow, I feel kind of dumb. I had it set to [4,0]. Thank you so much Bob!
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger