Keeping with the naming convetion I initially choosed.

This commit is contained in:
Sergiotarxz 2023-11-14 12:35:35 +01:00
parent bd8921a241
commit 87ece64a8c

View File

@ -42,14 +42,14 @@ sub generate_number_without_uppercase_and_end_marks($number) {
# This is done in this way attempting to split the big problem # This is done in this way attempting to split the big problem
# in many smaller problems. # in many smaller problems.
append_millions_to_return(\$number, \$return); append_millions_to_return(\$number, \$return);
my $there_is_hundred_thousands = append_thousand_hundreds(\$number, \$return); my $there_is_hundred_thousands = append_thousand_hundreds_to_return(\$number, \$return);
append_decene_thousands(\$number, \$return, $there_is_hundred_thousands); append_decene_thousands_to_return(\$number, \$return, $there_is_hundred_thousands);
append_hundred(\$number, \$return); append_hundred_to_return(\$number, \$return);
append_decene(\$number, \$return); append_decene_to_return(\$number, \$return);
return $return; return $return;
} }
sub append_decene($number_ref, $return_ref) { sub append_decene_to_return($number_ref, $return_ref) {
my $number = ${$number_ref}; my $number = ${$number_ref};
my $decene = int ($number / 1); my $decene = int ($number / 1);
return if ($decene < 1); return if ($decene < 1);
@ -58,7 +58,7 @@ sub append_decene($number_ref, $return_ref) {
${$number_ref} = 0; ${$number_ref} = 0;
} }
sub append_decene_thousands($number_ref, $return_ref, $there_is_hundred_thousands) { sub append_decene_thousands_to_return($number_ref, $return_ref, $there_is_hundred_thousands) {
my $number = ${$number_ref}; my $number = ${$number_ref};
my $thousand_decene_unit = int ($number / 1_000); my $thousand_decene_unit = int ($number / 1_000);
# This is needed for numbers such as 1_100_001 that do not have thousand decenes # This is needed for numbers such as 1_100_001 that do not have thousand decenes
@ -72,7 +72,7 @@ sub append_decene_thousands($number_ref, $return_ref, $there_is_hundred_thousand
${$number_ref} = $number % 1_000; ${$number_ref} = $number % 1_000;
} }
sub append_hundred($number_ref, $return_ref) { sub append_hundred_to_return($number_ref, $return_ref) {
my $number = ${$number_ref}; my $number = ${$number_ref};
my $hundred = int ($number / 100); my $hundred = int ($number / 100);
return if ($hundred < 1); return if ($hundred < 1);
@ -100,7 +100,7 @@ sub convert_two_chars_number_to_words($number) {
return $return; return $return;
} }
sub append_thousand_hundreds($number_ref, $return_ref) { sub append_thousand_hundreds_to_return($number_ref, $return_ref) {
my $number = ${$number_ref}; my $number = ${$number_ref};
my $thousand_hundreds_unit = int ($number / 100_000); my $thousand_hundreds_unit = int ($number / 100_000);
return if ($thousand_hundreds_unit < 1); return if ($thousand_hundreds_unit < 1);