pike.git / lib / modules / Geography.pmod / Position.pike

version» Context lines:

pike.git/lib/modules/Geography.pmod/Position.pike:86:      string prettyprint(float what,int n,string directions)   {    if (what<0) what=-what,directions=directions[1..];    else directions=directions[..0];       switch (n)    {    case -1: return sprintf("%.5g",what);    case 1: -  return sprintf("%.5g°%s",what,directions); +  return sprintf("%.3f°%s",what,directions);    case 3: -  return sprintf("%d°%d'%.3g\"%s", +  return sprintf("%d°%d'%.1f\"%s",    (int)floor(what),(int)floor(60*(what-floor(what))),    3600*(what-floor(60*what)/60),    directions);    default: -  return sprintf("%d°%.5g'%s", +  return sprintf("%d°%.3f'%s",    (int)floor(what),60*(what-floor(what)),    directions);    }   }      //! @decl string latitude(void|int n)   //! @decl string longitude(void|int n)   //!   //! Returns the nicely formatted latitude or longitude.   //!