From 8acea57ad2590715e03aa01a767d06daad746311 Mon Sep 17 00:00:00 2001 From: daveluff Date: Fri, 19 Sep 2003 16:48:27 +0000 Subject: [PATCH] Add an overloaded function --- src/ATC/ATCutils.cxx | 11 ++++++++++- src/ATC/ATCutils.hxx | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/ATC/ATCutils.cxx b/src/ATC/ATCutils.cxx index 7fa9b3eb7..3bd30e10a 100644 --- a/src/ATC/ATCutils.cxx +++ b/src/ATC/ATCutils.cxx @@ -52,10 +52,19 @@ string ConvertNumToSpokenDigits(string n) { str += " "; } } - return(str); } + +// Convert an integer to spoken digits +string ConvertNumToSpokenDigits(int n) { + char buf[12]; // should be big enough!! + sprintf(buf, "%i", n); + string tempstr1 = buf; + return(ConvertNumToSpokenDigits(tempstr1)); +} + + // Convert a 2 digit rwy number to a spoken-style string string ConvertRwyNumToSpokenString(int n) { string nums[10] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"}; diff --git a/src/ATC/ATCutils.hxx b/src/ATC/ATCutils.hxx index 420b61632..7dfa1569d 100644 --- a/src/ATC/ATCutils.hxx +++ b/src/ATC/ATCutils.hxx @@ -40,6 +40,9 @@ SG_USING_STD(string); // Convert any number to spoken digits string ConvertNumToSpokenDigits(string n); +// Convert an integer to spoken digits +string ConvertNumToSpokenDigits(int n); + // Convert a 2 digit rwy number to a spoken-style string string ConvertRwyNumToSpokenString(int n); -- 2.39.5