Branch Coverage

blib/lib/Locale/CLDR/NumberFormatter.pm
Criterion Covered Total %
branch 111 182 60.9


line true false branch
20 0 788 if ($self->numbering_system->{$numbering_system}{'type'} eq "algorithmic")
43 10 782 if (grep {$_ eq $format;} @valid_formats)
48 0 782 if (my($locale_id, $type, $format) = $format =~ m[^(.*?)/(.*?)/(.*?)$]u)
57 17 765 if ($format =~ tr/\244//)
61 17 0 unless defined $currency
97 16 18 $for_cash ? :
105 8 9 $for_cash ? :
117 757 27 if exists $cache{$format}
119 17 10 if defined $currency
129 43 11 if (($prefix) = $to_parse =~ /^ ( (?: [^0-9\@#.,E'*] | (?: ' [^']* ' )++ )+ ) /ux)
132 15 39 if (($suffix) = $to_parse =~ / ( (?: [^0-9\@#.,E'] | (?: ' [^']* ' )++ )+ ) $ /ux)
146 0 54 if (($pad_character) = $prefix =~ /^\*(\p{Any})/u) { }
0 54 elsif (($pad_character) = $prefix =~ /\*(\p{Any})$/u) { }
0 54 elsif (($pad_character) = $suffix =~ /^\*(\p{Any})/u) { }
1 53 elsif (($pad_character) = $suffix =~ /\*(\p{Any})$/u) { }
163 1 53 defined $pad_character ? :
169 4 50 if $prefix =~ tr/%// or $suffix =~ tr/%//
170 2 52 if $prefix =~ tr/\x{2030}// or $suffix =~ tr/\x{2030}//
175 34 20 if defined $currency
181 0 54 if (my($digits) = $to_parse =~ /(\@+)/u) { }
196 0 54 if ($to_parse =~ tr/E//) { }
236 0 17 if ($increment)
243 17 0 if ($decimal_digits) { }
278 10 772 if exists $symbols{$symbols_type}{'alias'}
280 16 766 $number =~ s/^-//u ? :
284 17 765 if ($format->{'rounding'} or defined $for_cash)
287 17 0 if (defined $for_cash)
295 4 778 if ($pad_zero > 0)
303 782 0 $minimum_grouping_digits ? :
308 782 0 if ($minimum_grouping_digits and length $integer >= $minimum_grouping_digits or not $minimum_grouping_digits) { }
311 37 745 if (defined $minor_group and $separator) { }
324 21 761 if defined $decimal
335 32 1532 if ($type eq 'negative') { }
357 0 784 unless $self->numbering_system->{$numbering_system}{'type'} eq "numeric"
389 0 16 unless $format_data
398 0 16 if (my($locale_id, undef, $format) = $format_name =~ m[^(.*?)/(.*?)/(.*?)$]u)
400 0 0 if $locale
413 4 16 unless $data->{$format_name}
414 0 16 unless $data->{$format_name}{$type}
423 16 0 keys %data ? :
430 0 2 unless defined $result
443 6 22 if (not $plural and $format_rule =~ /(cardinal|ordinal)/u)
450 6 22 if ($plural)
458 2 26 if ($number =~ /^-/u) { }
4 22 elsif ($number =~ /\./u) { }
462 2 0 if ($format_rule =~ /\x{2192}\x{2192}/u) { }
0 0 elsif (my($rule_name) = $format_rule =~ /\x{2192}(.+)\x{2192}/u) { }
0 0 elsif ($format_rule =~ /=%%.*=/u) { }
0 0 elsif ($format_rule =~ /=%.*=/u) { }
0 0 elsif ($format_rule =~ /=.*=/u) { }
467 0 0 if ($rule_name =~ s/^%%/%/u)
471 0 0 if ($format_data) { }
495 4 0 if ($number >= 0 and $number < 1) { }
502 2 2 if ($format_rule =~ /\x{2192}\x{2192}/u) { }
0 2 elsif (my($rule_name) = $format_rule =~ /\x{2192}(.*)\x{2192}/u) { }
507 0 0 if ($rule_name =~ s/^%%/%/u)
511 0 0 if ($format_data) { }
519 2 2 if ($format_rule =~ /\x{2190}\x{2190}/u) { }
0 2 elsif (my($rule_name) = $format_rule =~ /\x{2190}(.+)\x{2190}/u) { }
524 0 0 if ($rule_name =~ s/^%%/%/u)
528 0 0 if ($format_data) { }
536 2 2 if ($format_rule =~ /=.*=/u)
537 0 2 if ($format_rule =~ /=%%.*=/u) { }
2 0 elsif ($format_rule =~ /=%.*=/u) { }
552 6 16 if ($format_rule =~ /\[.*\]/u)
553 0 6 if ($in_fraction_rule_set and $number * $base_value == 1) { }
0 6 elsif (not $in_fraction_rule_set || $number % $divisor) { }
565 4 18 if ($in_fraction_rule_set) { }
566 0 4 if (my($rule_name) = $format_rule =~ /\x{2190}(.*)\x{2190}/u) { }
0 4 elsif ($format_rule =~ /=.*=/u) { }
567 0 0 if (length $rule_name) { }
569 0 0 if ($rule_name =~ s/^%%/%/u)
573 0 0 if ($format_data) { }
589 6 12 if (my($rule_name) = $format_rule =~ /\x{2192}(.*)\x{2192}/u)
590 0 6 if (length $rule_name) { }
592 0 0 if ($rule_name =~ s/^%%/%/u)
596 0 0 if ($format_data) { }
608 0 18 if (my($rule_name) = $format_rule =~ /\x{2190}(.*)\x{2190}/u)
609 0 0 if (length $rule_name) { }
611 0 0 if ($rule_name =~ s/^%%/%/u)
615 0 0 if ($format_data) { }
627 8 10 if ($format_rule =~ /=.*=/u)
628 0 8 if ($format_rule =~ /=%%.*=/u) { }
4 4 elsif ($format_rule =~ /=%.*=/u) { }
659 2 0 if $number =~ /^-/u and exists $format_data->{'-x'}
660 2 2 if $number =~ /\./u and exists $format_data->{'x.x'}
661 12 12 if $number == bless( {"_e" => bless( [0], 'Math::BigInt::Calc' ),"_es" => "+","_m" => bless( [0], 'Math::BigInt::Calc' ),"sign" => "+"}, 'Math::BigFloat' ) or $number =~ /^-/u
662 4 8 if $number >= $format_data->{'max'}{'base_value'}
666 8 134 if $key == bless( {"_e" => bless( [0], 'Math::BigInt::Calc' ),"_es" => "+","_m" => bless( [0], 'Math::BigInt::Calc' ),"sign" => "+"}, 'Math::BigFloat' )
667 2 132 if $number == $key
668 6 126 if $number < $key