Changeset 11372 for trunk/psModules/src/concepts/pmConceptsStandard.c
- Timestamp:
- Jan 29, 2007, 11:12:55 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/concepts/pmConceptsStandard.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/concepts/pmConceptsStandard.c
r11358 r11372 237 237 238 238 // We choose to write sexagesimal format 239 int big, medium; 240 float small; 241 big = (int)coords; 242 medium = (int)(60.0*(coords - (double)big)); 243 small = 3600.0*(coords - (double)big - 60.0 * (double)medium); 239 int big, medium; // Degrees and minutes 240 float small; // Seconds 241 bool negative = (coords < 0); // Are we working below zero? 242 coords = fabs(coords); 243 big = (int)abs(coords); 244 coords -= big; 245 medium = 60.0 * coords; 246 coords -= medium / 60.0; 247 small = 3600.0 * coords; 248 if (negative) { 249 big *= -1; 250 } 244 251 psString coordString = NULL; // String with the coordinates in sexagesimal format 245 psStringAppend(&coordString, "%d:% d:%.2f", big, medium, small);252 psStringAppend(&coordString, "%d:%02d:%05.2f", big, medium, small); 246 253 psMetadataItem *coordItem = psMetadataItemAllocStr(concept->name, concept->comment, coordString); 247 254 psFree(coordString);
Note:
See TracChangeset
for help on using the changeset viewer.
