Diff of /trunk/src/misc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 13 by harbaum, Sat Jun 27 11:09:19 2009 UTC revision 34 by harbaum, Wed Jul 29 19:24:15 2009 UTC
# Line 241  pos_t *get_pos(appdata_t *appdata) { Line 241  pos_t *get_pos(appdata_t *appdata) {
241  }  }
242    
243  void distance_str(char *str, int len, float dist, gboolean imperial) {  void distance_str(char *str, int len, float dist, gboolean imperial) {
244    if(imperial) {    if(isnan(dist))
245        snprintf(str, len, "---");
246      else if(imperial) {
247      /* 1 mil = 1760 yd = 5280 ft ... */      /* 1 mil = 1760 yd = 5280 ft ... */
248      if(dist<0.018)      snprintf(str, len, "%.1f ft", dist*5280.0);      if(dist<0.018)      snprintf(str, len, "%.1f ft", dist*5280.0);
249      else if(dist<0.055) snprintf(str, len, "%.1f yd", dist*1760.0);      else if(dist<0.055) snprintf(str, len, "%.1f yd", dist*1760.0);

Legend:
Removed from v.13  
changed lines
  Added in v.34