[aprssig] perl Geo::Ellipsoid

Wes Johnston, AI4PX wes at ai4px.com
Wed May 4 10:56:19 EDT 2011


Try this....  well I use it to pad integers, haven't tried with decimals.

sprintf("%03s", $dist);

Wes
---
The world needs more geniuses with humility because there are so few of us
left.



On Wed, May 4, 2011 at 10:32, Andrew Rich <vk4tec at tech-software.net> wrote:

>  Wonder is someone can help
>
> I want to format a number in perl
>
> 3 leading 0 padded
> 2 trailing decimal places
>
> Do I have to treat to the left of the decimal point and to the right as two
> seperates ?
>
> I want 3.4565443 to look like "003.456"
>
> Working on some GPS code
>
> Using sprintf
>
> This puts 3 leading and zero pads:-
>
> $dist = sprintf("%3d",$dist);
> $bearing = sprintf("%3d",$bearing);
>
> This puts two trailing :-
>
> print "RNG = ".sprintf("%.2f",$dist)."\n";
> print "BRG = ".sprintf("%.2f",$bearing)."\n";
>
> How do i put them together ?
>
>
>
> - Andrew VK4TEC -
>
>
>   ----- Original Message -----
> *From:* Andrew Rich <vk4tec at tech-software.net>
> *To:* TAPR APRS Mailing List <aprssig at tapr.org>
> *Sent:* Wednesday, May 04, 2011 8:14 AM
> *Subject:* [aprssig] perl Geo::Ellipsoid
>
> Hello
>
> I have an idea, although not new, but novel
>
> I am taking a small netbook and LINUX and a GPS.
>
> I now have the flexibility to do anything with it.
>
> I can program and make the netbook do what ever I want.
>
> One thing I am playing with is the perl Geo::Ellispoid module.
>
> This allows me to get range and bearing, and also I am working on ETA code
> as well.
>
> - Andrew -
>
> ------------------------------
>
> _______________________________________________
> aprssig mailing list
> aprssig at tapr.org
> https://www.tapr.org/cgi-bin/mailman/listinfo/aprssig
>
>
> _______________________________________________
> aprssig mailing list
> aprssig at tapr.org
> https://www.tapr.org/cgi-bin/mailman/listinfo/aprssig
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.tapr.org/pipermail/aprssig_lists.tapr.org/attachments/20110504/3798413c/attachment.html>


More information about the aprssig mailing list