+/*
+ * viking -- GPS Data and Topo Analyzer, Explorer, and Manager
+ *
+ * Copyright (C) 2006-2007, Guilhem Bonnefille <guilhem.bonnefille@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef HAVE_MATH_H
#include <math.h>
+#endif
#include <glib.h>
-#include <stdio.h>
#include <string.h>
+#define DEGREE_SYMBOL "\302\260"
+
/**
* @param pos_c char for positive value
* @param neg_c char for negative value
val_d = fabs(dec);
/* Format */
- /* TODO : replace "°" as UTF-8 */
- result = g_strdup_printf ( "%c%f°", sign_c, val_d );
+ result = g_strdup_printf ( "%c%f" DEGREE_SYMBOL, sign_c, val_d );
return result;
}
val_m = (tmp - val_d) * 60;
/* Format */
- /* TODO : replace "°" as UTF-8 */
- result = g_strdup_printf ( "%c%d°%f'",
+ result = g_strdup_printf ( "%c%d" DEGREE_SYMBOL "%f'",
sign_c, val_d, val_m );
return result;
}
val_s = (tmp - val_m) * 60;
/* Format */
- /* TODO : replace "°" as UTF-8 */
- result = g_strdup_printf ( "%c%d°%d'%f\"",
+ result = g_strdup_printf ( "%c%d" DEGREE_SYMBOL "%d'%f\"",
sign_c, val_d, val_m, val_s );
return result;
}