]> git.lizzy.rs Git - minetest.git/commitdiff
Display whole profiler numbers up to 999999 without scientific notation. (#13155)
authorlhofhansl <larsh@apache.org>
Wed, 25 Jan 2023 01:40:23 +0000 (17:40 -0800)
committerGitHub <noreply@github.com>
Wed, 25 Jan 2023 01:40:23 +0000 (17:40 -0800)
src/profiler.cpp

index d13afc882ecbd3dc0f8b562a4bdfa002dcc8c4b0..ab05f7382136937019ece2c9291d666238514373 100644 (file)
@@ -154,8 +154,8 @@ int Profiler::print(std::ostream &o, u32 page, u32 pagecount)
                        o << buffer;
                }
 
-               porting::mt_snprintf(buffer, sizeof(buffer), "% 5ix % 4.4g",
-                               getAvgCount(i.first), i.second);
+               porting::mt_snprintf(buffer, sizeof(buffer), "% 5ix % 7g",
+                               getAvgCount(i.first), floor(i.second * 1000.0) / 1000.0);
                o << buffer << std::endl;
        }
        return values.size();