| 1 | package Geo::Formatter::Format::Degree; | ||||||||||||
| 2 | |||||||||||||
| 3 | 6 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 6 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 6 | ▶ | use Carp; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 6 | ▶ | use base qw(Geo::Formatter::FormatBase::Double); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | 6 | ▶ | use version; our $VERSION = qv('0.0.1'); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | |||||||||||||
| 10 | 7 | ▶ | sub encode { | ||||||||||
|
Subroutine
encode: called CC=5 SCAR=16.1
Pod
documented
| |||||||||||||
| 11 | 7 | my ($class,$lat,$lng,$opt) = @_; | |||||||||||
| 12 | |||||||||||||
| 13 | 7 | ▶ | $opt ||= {}; | ||||||||||
|
Condition50%1/2
$opt ||= {}
MC/DC0%0/1
$opt ||= {}
$opt
Truth table50%1/2
A
A= $opt
| |||||||||||||
| 14 | |||||||||||||
| 15 | 7 | ▶ | my $under_decimal = defined($opt->{under_decimal}) ? $opt->{under_decimal} : 6; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 16 | 7 | ▶ | my $sign = $opt->{sign} || 0; | ||||||||||
|
Condition100%2/2
$opt->{'sign'} || 0
MC/DC100%1/1
$opt->{'sign'} || 0
$opt->{'sign'}
Truth table100%2/2
A
A= $opt->{'sign'}
| |||||||||||||
| 17 | |||||||||||||
| 18 | 7 | ▶ | my $form = sprintf("%%%s.%df",$sign ? "+" : "", $under_decimal); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 19 | 7 | map { sprintf($form,$_) } ($lat,$lng); | |||||||||||
| 20 | } | ||||||||||||
| 21 | |||||||||||||
| 22 | 6 | ▶ | sub decode { | ||||||||||
|
Subroutine
decode: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 23 | 6 | map { $_ + 0.0 }@_[1..2]; | |||||||||||
| 24 | } | ||||||||||||
| 25 | |||||||||||||
| 26 | 6 | 1; | |||||||||||
| 27 | |||||||||||||
| 28 | __END__ | ||||||||||||