From: erickson Date: Thu, 10 Nov 2005 19:03:17 +0000 (+0000) Subject: tosimplestring now returns int/double as expected X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=494a0d9e52e5cae53f4c28b94f9fb518046ce315;p=opensrf%2Fbjwebb.git tosimplestring now returns int/double as expected git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@578 9efc2488-bf62-4759-914b-345cdb29e865 --- 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; }