From 494a0d9e52e5cae53f4c28b94f9fb518046ce315 Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 10 Nov 2005 19:03:17 +0000 Subject: [PATCH] tosimplestring now returns int/double as expected git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@578 9efc2488-bf62-4759-914b-345cdb29e865 --- src/objson/object.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/objson/object.c b/src/objson/object.c index f427936..e70836b 100644 --- a/src/objson/object.c +++ b/src/objson/object.c @@ -760,8 +760,16 @@ char* jsonObjectToSimpleString( const jsonObject* o ) { switch( o->type ) { case JSON_NUMBER: { - DOUBLE_TO_STRING(o->value.n); - value = strdup(DOUBLESTR); + + if( o->value.n == (int) o->value.n ) { + INT_TO_STRING((int) o->value.n); + value = strdup(INTSTR); + + } else { + DOUBLE_TO_STRING(o->value.n); + value = strdup(DOUBLESTR); + } + break; } -- 2.11.0