Changeset 655 for trunk/bin/module_maker/validation.cli.php
- Timestamp:
- Jan 24, 2019 7:22:55 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/module_maker/validation.cli.php
r612 r655 286 286 case 'numeric' : 287 287 case 'float' : 288 $max = str_repeat('9', $max_dig - $max_dec);289 if ($max_dec > 0) {290 $max .= '.' . str_repeat('9', $max_dec);291 }292 288 if ($unsigned) { 293 289 $negative_ok = 'false'; 294 $min = 0;295 290 } else { 296 291 $negative_ok = 'true'; 297 $min = -$max;298 292 } 299 293 $negative_ok = $unsigned ? 'false' : 'true'; 300 $o[] = "\$fv->isDecimal('$field', sprintf(_(\"%s must be a number between %d and %d.\"), _(\"$title\"), $min, $max), $negative_ok, $max_dig, $max_dec);";294 $o[] = "\$fv->isDecimal('$field', $max_dig, $max_dec, false, sprintf(_(\"%s must be a number with a maximum of %d integer digits and %d fractional digits, e.g., {EX}.\"), _(\"$title\"), ${max_dig}-${max_dec}, $max_dec), MSG_ERR, __FILE__, __LINE__);"; 301 295 break; 302 296
Note: See TracChangeset
for help on using the changeset viewer.