Tell me more ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

when using the Drupal FAPI and needing a float number field you have to use type textfield. What's the best way to validate that this data is a float during hook_form_validate9)? Is there a built in function. or do you have to do is_float()?

Thanks.

share|improve this question

1 Answer

Drupal does not have an is_float() wrapper function. So yes, if you want to check to see if a string is a float, use PHP's native is_float().

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.