[aprssig] perl Geo::Ellipsoid

Andrew Rich vk4tec at tech-software.net
Wed May 4 10:42:25 EDT 2011


Worked it out 

$dist = sprintf("%06.2f",$dist);
$bearing = sprintf("%06.2f",$bearing);

3 leading - zero padded , 2 trailing 

- Andrew - 
  ----- Original Message ----- 
  From: Andrew Rich 
  To: Andrew Rich ; TAPR APRS Mailing List 
  Sent: Thursday, May 05, 2011 12:32 AM
  Subject: Re: [aprssig] perl Geo::Ellipsoid


  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 
    To: TAPR APRS Mailing List 
    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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.tapr.org/pipermail/aprssig_lists.tapr.org/attachments/20110505/a29f9682/attachment.html>


More information about the aprssig mailing list