Code Duplication    Length = 9-10 lines in 2 locations

includes/formatting.php 2 locations

@@ 498-507 (lines=10) @@
495
	$human_format_amount = $amount;
496
497
	switch ( $args['currency'] ) {
498
		case 'INR':
499
			// Calculate large number formatted amount.
500
			if ( 4 < $amount_count_parts ) {
501
				$human_format_amount = sprintf( esc_html__( '%s arab', 'give' ), round( ( $sanitize_amount / 1000000000 ), 2 ) );
502
			} elseif ( 3 < $amount_count_parts ) {
503
				$human_format_amount = sprintf( esc_html__( '%s crore', 'give' ), round( ( $sanitize_amount / 10000000 ), 2 ) );
504
			} elseif ( 2 < $amount_count_parts ) {
505
				$human_format_amount = sprintf( esc_html__( '%s lakh', 'give' ), round( ( $sanitize_amount / 100000 ), 2 ) );
506
			}
507
			break;
508
		default:
509
			// Calculate large number formatted amount.
510
			if ( 4 < $amount_count_parts ) {
@@ 508-516 (lines=9) @@
505
				$human_format_amount = sprintf( esc_html__( '%s lakh', 'give' ), round( ( $sanitize_amount / 100000 ), 2 ) );
506
			}
507
			break;
508
		default:
509
			// Calculate large number formatted amount.
510
			if ( 4 < $amount_count_parts ) {
511
				$human_format_amount = sprintf( esc_html__( '%s trillion', 'give' ), round( ( $sanitize_amount / 1000000000000 ), 2 ) );
512
			} elseif ( 3 < $amount_count_parts ) {
513
				$human_format_amount = sprintf( esc_html__( '%s billion', 'give' ), round( ( $sanitize_amount / 1000000000 ), 2 ) );
514
			} elseif ( 2 < $amount_count_parts ) {
515
				$human_format_amount = sprintf( esc_html__( '%s million', 'give' ), round( ( $sanitize_amount / 1000000 ), 2 ) );
516
			}
517
	}
518
519
	return apply_filters( 'give_human_format_large_amount', $human_format_amount, $amount, $sanitize_amount );