pike.git/
lib/
modules/
Geography.pmod/
Position.pike
Branch:
Tag:
Non-build tags
All tags
No tags
2003-07-18
2003-07-18 21:17:34 by Mirar (Pontus Hagland) <pike@sort.mirar.org>
47bd508a5ef2876dea00ce2f799b108012c099d6 (
7
lines) (+
4
/-
3
)
[
Show
|
Annotate
]
Branch:
7.9
better default prettyprinting of positions
Rev: lib/modules/Geography.pmod/Position.pike:1.14
93:
{ 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); }