Changeset 534 for trunk/lib/FormValidator.inc.php
- Timestamp:
- Jul 27, 2015 7:56:08 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FormValidator.inc.php
r502 r534 384 384 385 385 /** 386 * Check whether input is a Decimal or Fixed type. Check values to be stored in mysql decimal, numeric, num, or fixed types. 387 * Note: some integers and floats will also pass this test. 388 * https://dev.mysql.com/doc/refman/5.5/en/fixed-point-types.html 389 * 390 * @param string $form_name the name of the incoming form variable 391 * @param string $msg the message to display on error 392 * @param string $val The input data to validate. 393 * @param bool $negative_ok If the value can be unsigned. 394 * @param int $max Total max number of digits. 395 * @param int $dec Total max number of digits after the decimal place. 396 * @return bool true if value is a float 397 */ 398 public function isDecimal($form_name, $msg='', $negative_ok=false, $max=10, $dec=2) 399 { 400 if (Validator::isDecimal(getFormData($form_name), $negative_ok, $max, $dec)) { 401 return true; 402 } else { 403 $this->addError($form_name, $msg); 404 return false; 405 } 406 } 407 408 /** 386 409 * Check whether input is an array. 387 410 *
Note: See TracChangeset
for help on using the changeset viewer.