From d24ea0e916623f93136c9545a7f43418ca1b86ac Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 2 May 2016 15:11:43 +0200 Subject: [PATCH] add a 0 before the PRN number if smaller than 10 --- src/core/system_parameters/gnss_satellite.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/system_parameters/gnss_satellite.cc b/src/core/system_parameters/gnss_satellite.cc index ea1598e3f..ddf2ef9ac 100644 --- a/src/core/system_parameters/gnss_satellite.cc +++ b/src/core/system_parameters/gnss_satellite.cc @@ -78,8 +78,10 @@ void Gnss_Satellite::reset() std::ostream& operator<<(std::ostream &out, const Gnss_Satellite &sat) // output { std::string tag(""); + std::string tag2(""); if(sat.get_system().compare("Galileo") == 0) tag = "E"; - out << sat.get_system() << " PRN " << tag << sat.get_PRN() << " (Block " << sat.get_block() << ")"; + if(sat.get_PRN() < 10) tag2 = "0"; + out << sat.get_system() << " PRN " << tag << tag2 << sat.get_PRN() << " (Block " << sat.get_block() << ")"; return out; }