Acme-Geo-Whitwell-Name
view release on metacpan or search on metacpan
lib/Acme/Geo/Whitwell/Name.pm view on Meta::CPAN
$current = !$current;
next PARSE;
}
}
# The current table should have matched, so the input string is bad.
croak "Bad character or sequencing found in '$original' at '$string'";
}
# Insert the decimal point such that the resulting number is < 180.
# This allows "high-precision" Whitwell names (constructed in some
# manner other than via to_whitwell) to be converted back correctly.
if (length($coord_string) >= 3) {
# Need to insert a decimal point. The final value must be < 180,
# and we asssume at least two decimal places.
# Let's try the easy case first, and insert a decimal point
# right before the last two digits. All names generated via
# to_whitwell() will work with this case. Since we know the
# coordinate string only has numbers in it, we can just divide
# by 100.
my $trial_value = $coord_string/100;
( run in 0.322 second using v1.01-cache-2.11-cpan-65fba6d93b7 )