changeset 5293:ef6d4e794401

ParseJson: try integers before doubles
author Alain Mazy <am@osimis.io>
date Wed, 10 May 2023 11:54:59 +0200
parents 143b45791233
children e0e2aee4453e
files OrthancFramework/Sources/Lua/LuaContext.cpp
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/Lua/LuaContext.cpp	Tue May 09 18:19:15 2023 +0200
+++ b/OrthancFramework/Sources/Lua/LuaContext.cpp	Wed May 10 11:54:59 2023 +0200
@@ -396,10 +396,6 @@
       const std::string s = value.asString();
       lua_pushlstring(lua_, s.c_str(), s.size());
     }
-    else if (value.isDouble())
-    {
-      lua_pushnumber(lua_, value.asDouble());
-    }
     else if (value.isInt())
     {
       lua_pushinteger(lua_, value.asInt());
@@ -408,6 +404,10 @@
     {
       lua_pushinteger(lua_, value.asUInt());
     }
+    else if (value.isDouble())
+    {
+      lua_pushnumber(lua_, value.asDouble());
+    }
     else if (value.isBool())
     {
       lua_pushboolean(lua_, value.asBool());