- if ( a_vik_get_units_distance() == VIK_UNITS_DISTANCE_MILES ) {
- g_snprintf (tbuf4, sizeof(tbuf4), "miles");
- len_in_units = VIK_METERS_TO_MILES(tt.length);
- }
- else {
- g_snprintf (tbuf4, sizeof(tbuf4), "kms");
- len_in_units = tt.length/1000.0;
+ switch ( a_vik_get_units_distance() ) {
+ case VIK_UNITS_DISTANCE_MILES:
+ g_snprintf (tbuf4, sizeof(tbuf4), "miles");
+ len_in_units = VIK_METERS_TO_MILES(tt.length);
+ break;
+ case VIK_UNITS_DISTANCE_NAUTICAL_MILES:
+ g_snprintf (tbuf4, sizeof(tbuf4), "NM");
+ len_in_units = VIK_METERS_TO_NAUTICAL_MILES(tt.length);
+ break;
+ default:
+ g_snprintf (tbuf4, sizeof(tbuf4), "kms");
+ len_in_units = tt.length/1000.0;
+ break;