From 7471843374f1a75f7a349aac44aaae58d08e6d9a Mon Sep 17 00:00:00 2001 From: Sacha Ligthert Date: Sun, 14 Jan 2024 23:11:13 +0100 Subject: [PATCH] Ensure a number is a number. --- Export.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Export.lua b/Export.lua index 1170101..c480a90 100644 --- a/Export.lua +++ b/Export.lua @@ -45,7 +45,7 @@ function LuaExportActivityNextEvent(t) print(v.Type) -- add this line for debugging purposes local objectType = "unknown" objectType = type(v.Type) - json = json .. string.format('{"age_in_seconds":"%.1f", "unit_name":"%s", "group_name":"%s", "name":"%s", "latitude":%f, "longitude":%f, "altitude_in_feet":%f, "heading_in_rads":%f, "pitch_in_rads":%f, "bank_in_rads":%f, "coalition":"%s", "type":"%s"},', t, v.UnitName, v.GroupName, v.Name, v.LatLongAlt.Lat, v.LatLongAlt.Long, v.LatLongAlt.Alt, v.Heading, v.Pitch, v.Bank, v.Coalition, objectType ) + json = json .. string.format('{"age_in_seconds": %.1f, "unit_name":"%s", "group_name":"%s", "name":"%s", "latitude":%f, "longitude":%f, "altitude_in_feet":%f, "heading_in_rads":%f, "pitch_in_rads":%f, "bank_in_rads":%f, "coalition":"%s", "type":"%s"},', t, v.UnitName, v.GroupName, v.Name, v.LatLongAlt.Lat, v.LatLongAlt.Long, v.LatLongAlt.Alt, v.Heading, v.Pitch, v.Bank, v.Coalition, objectType ) end -- Remove trialing comma