diff --git a/src/ExprNode.cc b/src/ExprNode.cc
index 427870456a26a9193185f3813e5916bc8b7e016f..9870c37c60da3e132198caa456745ed046a0e691 100644
--- a/src/ExprNode.cc
+++ b/src/ExprNode.cc
@@ -451,7 +451,7 @@ void
 NumConstNode::writeJsonAST(ostream &output) const
 {
   output << R"({"node_type" : "NumConstNode", "value" : )";
-  output << datatree.num_constants.get(id) << "}";
+  output << std::stof(datatree.num_constants.get(id)) << "}";
 }
 
 void