| @@ 695-717 (lines=23) @@ | ||
| 692 | * |
|
| 693 | * @return int |
|
| 694 | */ |
|
| 695 | public function get_max_decimals( $options ) { |
|
| 696 | ||
| 697 | $length = (int) pods_v( static::$type . '_max_length', $options, 12, true ); |
|
| 698 | ||
| 699 | if ( $length < 1 || 64 < $length ) { |
|
| 700 | $length = 64; |
|
| 701 | } |
|
| 702 | ||
| 703 | $decimals = (int) pods_v( static::$type . '_decimals', $options, 2 ); |
|
| 704 | ||
| 705 | if ( $decimals < 1 ) { |
|
| 706 | $decimals = 0; |
|
| 707 | } elseif ( 30 < $decimals ) { |
|
| 708 | $decimals = 30; |
|
| 709 | } |
|
| 710 | ||
| 711 | if ( $length < $decimals ) { |
|
| 712 | $decimals = $length; |
|
| 713 | } |
|
| 714 | ||
| 715 | return $decimals; |
|
| 716 | } |
|
| 717 | } |
|
| 718 | ||
| @@ 389-411 (lines=23) @@ | ||
| 386 | * |
|
| 387 | * @return int |
|
| 388 | */ |
|
| 389 | public function get_max_decimals( $options ) { |
|
| 390 | ||
| 391 | $length = (int) pods_v( static::$type . '_max_length', $options, 12, true ); |
|
| 392 | ||
| 393 | if ( $length < 1 || 64 < $length ) { |
|
| 394 | $length = 64; |
|
| 395 | } |
|
| 396 | ||
| 397 | $decimals = (int) pods_v( static::$type . '_decimals', $options, 0 ); |
|
| 398 | ||
| 399 | if ( $decimals < 1 ) { |
|
| 400 | $decimals = 0; |
|
| 401 | } elseif ( 30 < $decimals ) { |
|
| 402 | $decimals = 30; |
|
| 403 | } |
|
| 404 | ||
| 405 | if ( $length < $decimals ) { |
|
| 406 | $decimals = $length; |
|
| 407 | } |
|
| 408 | ||
| 409 | return $decimals; |
|
| 410 | } |
|
| 411 | } |
|
| 412 | ||