Code Duplication    Length = 9-10 lines in 2 locations

includes/formatting.php 2 locations

@@ 320-329 (lines=10) @@
317
	$human_format_amount = $amount;
318
319
	switch ( $args['currency'] ) {
320
		case 'INR':
321
			// Calculate large number formatted amount.
322
			if ( 4 < $amount_count_parts ) {
323
				$human_format_amount = sprintf( esc_html__( '%s arab', 'give' ), round( ( $sanitize_amount / 1000000000 ), 2 ) );
324
			} elseif ( 3 < $amount_count_parts ) {
325
				$human_format_amount = sprintf( esc_html__( '%s crore', 'give' ), round( ( $sanitize_amount / 10000000 ), 2 ) );
326
			} elseif ( 2 < $amount_count_parts ) {
327
				$human_format_amount = sprintf( esc_html__( '%s lakh', 'give' ), round( ( $sanitize_amount / 100000 ), 2 ) );
328
			}
329
			break;
330
		default:
331
			// Calculate large number formatted amount.
332
			if ( 4 < $amount_count_parts ) {
@@ 330-338 (lines=9) @@
327
				$human_format_amount = sprintf( esc_html__( '%s lakh', 'give' ), round( ( $sanitize_amount / 100000 ), 2 ) );
328
			}
329
			break;
330
		default:
331
			// Calculate large number formatted amount.
332
			if ( 4 < $amount_count_parts ) {
333
				$human_format_amount = sprintf( esc_html__( '%s trillion', 'give' ), round( ( $sanitize_amount / 1000000000000 ), 2 ) );
334
			} elseif ( 3 < $amount_count_parts ) {
335
				$human_format_amount = sprintf( esc_html__( '%s billion', 'give' ), round( ( $sanitize_amount / 1000000000 ), 2 ) );
336
			} elseif ( 2 < $amount_count_parts ) {
337
				$human_format_amount = sprintf( esc_html__( '%s million', 'give' ), round( ( $sanitize_amount / 1000000 ), 2 ) );
338
			}
339
	}
340
341
	return apply_filters( 'give_human_format_large_amount', $human_format_amount, $amount, $sanitize_amount );