File Coverage

lib/Spreadsheet/Engine/Function/N.pm
Criterion Covered Total %
statement 13 13 100.0
branch 1 2 50.0
condition n/a
subroutine 5 5 100.0
pod 2 2 100.0
total 21 22 95.4


line stmt bran cond sub pod time code
1             package Spreadsheet::Engine::Function::N;
2              
3 28     28   174 use strict;
  28         60  
  28         1243  
4 28     28   150 use warnings;
  28         64  
  28         770  
5              
6 28     28   152 use base 'Spreadsheet::Engine::Fn::base';
  28         55  
  28         5973  
7              
8 220     220 1 571 sub argument_count { 1 }
9              
10             sub result {
11 201     201 1 364 my $self = shift;
12 201         807 my $op = $self->next_operand;
13              
14 201 50       4939 return Spreadsheet::Engine::Value->new(
15             type => 'n',
16             value => $op->is_num ? $op->value : 0
17             );
18             }
19              
20             1;
21              
22             __END__