From 793c78512e5776e1b27b73bf72abbf065febde1c Mon Sep 17 00:00:00 2001 From: James Turner Date: Mon, 7 Nov 2016 15:29:17 +0100 Subject: [PATCH] Prettier terrasync progress on splash screen. --- src/Viewer/splash.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Viewer/splash.cxx b/src/Viewer/splash.cxx index a86a93b21..21ec44399 100644 --- a/src/Viewer/splash.cxx +++ b/src/Viewer/splash.cxx @@ -435,7 +435,12 @@ void fgSplashProgress( const char *identifier, unsigned int percent ) { } } if (kbytesPerSec > 0) { - oss << " - " << kbytesPerSec << " Kb/sec"; + if (kbytesPerSec > 100) { + double mbytesPerSec = kbytesPerSec / 1024.0; + oss << " - " << std::fixed << std::setprecision(1) << mbytesPerSec << "Mb/sec"; + } else { + oss << " - " << kbytesPerSec << " Kb/sec"; + } } fgSetString("/sim/startup/splash-progress-text", oss.str()); return;