From 4cffc39d3a47be448c141d019630abf6438d6cf1 Mon Sep 17 00:00:00 2001 From: Christophe de Dinechin Date: Mon, 12 Feb 2024 00:04:12 +0100 Subject: [PATCH] units: Add `dms` unit to angles menu Add the `dms` unit to angles menu, with value "one degree" so that we can convert between DMS and decimal degrees using the normal units menu. Fixes: #818 Signed-off-by: Christophe de Dinechin --- config/units.csv | 1 + src/unit.cc | 1 + 2 files changed, 2 insertions(+) diff --git a/config/units.csv b/config/units.csv index 0f94f4d6..bd5eef49 100644 --- a/config/units.csv +++ b/config/units.csv @@ -301,6 +301,7 @@ "r", "0.1591549430918953357688837633725144_turn" "πr", "1/2_turn" +"dms", "1_°" "arcmin", "1/60_°" "arcs", "1/60_arcmin" "sr", "1_sr" diff --git a/src/unit.cc b/src/unit.cc index b63755fa..e7616b7f 100644 --- a/src/unit.cc +++ b/src/unit.cc @@ -640,6 +640,7 @@ static const cstring basic_units[] = "r", "0.1591549430918953357688837633725144_turn", // Radian "πr", "1/2_turn", // Pi radians + "dms", "1_°", // Degrees shown as DMS "arcmin", "1/60_°", // Arc minute "arcs", "1/60_arcmin", // Arc second "sr", "1_sr", // Steradian