Diff

plugins/mod_admin_telnet.lua @ 9786:00f7af0be849

mod_admin_telnet: sttas:show: Use format option that allows float numbers string.format("%d", 0.5) causes an error on Lua 5.3
author Kim Alvefur <zash@zash.se>
date Wed, 16 Jan 2019 14:20:16 +0100
parent 9756:38f7bde4cfe0
child 9868:0361e3379dd1
line wrap: on
line diff
--- a/plugins/mod_admin_telnet.lua	Wed Jan 16 13:53:04 2019 +0100
+++ b/plugins/mod_admin_telnet.lua	Wed Jan 16 14:20:16 2019 +0100
@@ -1255,7 +1255,7 @@
 	--do return tostring(value) end
 	if type == "duration" then
 		if ref_value < 0.001 then
-			return ("%d µs"):format(value*1000000);
+			return ("%g µs"):format(value*1000000);
 		elseif ref_value < 0.9 then
 			return ("%0.2f ms"):format(value*1000);
 		end