aboutsummaryrefslogtreecommitdiffstats
path: root/include/crow/json.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/crow/json.h')
-rw-r--r--include/crow/json.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/crow/json.h b/include/crow/json.h
index bdef117..1f28af5 100644
--- a/include/crow/json.h
+++ b/include/crow/json.h
@@ -656,7 +656,17 @@ namespace crow
case type::Null: os << "null"; break;
case type::False: os << "false"; break;
case type::True: os << "true"; break;
- case type::Number: os << r.d(); break;
+ case type::Number:
+ {
+ switch (r.nt())
+ {
+ case num_type::Floating_point: os << r.d(); break;
+ case num_type::Signed_integer: os << r.i(); break;
+ case num_type::Unsigned_integer: os << r.u(); break;
+ case num_type::Null: throw std::runtime_error("Number with num_type Null");
+ }
+ }
+ break;
case type::String: os << '"' << r.s() << '"'; break;
case type::List:
{