Code Duplication    Length = 23-23 lines in 2 locations

classes/fields/currency.php 1 location

@@ 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

classes/fields/number.php 1 location

@@ 495-517 (lines=23) @@
492
	 *
493
	 * @return int
494
	 */
495
	public function get_max_decimals( $options ) {
496
497
		$length = (int) pods_v( static::$type . '_max_length', $options, 12, true );
498
499
		if ( $length < 1 || 64 < $length ) {
500
			$length = 64;
501
		}
502
503
		$decimals = (int) pods_v( static::$type . '_decimals', $options, 0 );
504
505
		if ( $decimals < 1 ) {
506
			$decimals = 0;
507
		} elseif ( 30 < $decimals ) {
508
			$decimals = 30;
509
		}
510
511
		if ( $length < $decimals ) {
512
			$decimals = $length;
513
		}
514
515
		return $decimals;
516
	}
517
}
518