Code Duplication    Length = 23-23 lines in 2 locations

classes/fields/number.php 1 location

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

classes/fields/currency.php 1 location

@@ 615-637 (lines=23) @@
612
	 *
613
	 * @return int
614
	 */
615
	public function get_max_decimals( $options ) {
616
617
		$length = (int) pods_v( static::$type . '_max_length', $options, 12, true );
618
619
		if ( $length < 1 || 64 < $length ) {
620
			$length = 64;
621
		}
622
623
		$decimals = (int) pods_v( static::$type . '_decimals', $options, 2 );
624
625
		if ( $decimals < 1 ) {
626
			$decimals = 0;
627
		} elseif ( 30 < $decimals ) {
628
			$decimals = 30;
629
		}
630
631
		if ( $length < $decimals ) {
632
			$decimals = $length;
633
		}
634
635
		return $decimals;
636
	}
637
}
638