mirror of
https://github.com/privacore/open-source-search-engine.git
synced 2025-07-17 02:56:07 -04:00
print numbers as strings when printing the csv
This commit is contained in:
@ -8371,6 +8371,7 @@ bool printJsonItemInCSV ( char *json , SafeBuf *sb , State0 *st ) {
|
||||
//
|
||||
// get value and print otherwise
|
||||
//
|
||||
/*
|
||||
if ( ji->m_type == JT_NUMBER ) {
|
||||
// print numbers without double quotes
|
||||
if ( ji->m_valueDouble *10000000.0 ==
|
||||
@ -8380,11 +8381,15 @@ bool printJsonItemInCSV ( char *json , SafeBuf *sb , State0 *st ) {
|
||||
sb->safePrintf("%f",ji->m_valueDouble);
|
||||
continue;
|
||||
}
|
||||
*/
|
||||
|
||||
int32_t vlen;
|
||||
char *str = ji->getValueAsString ( &vlen );
|
||||
|
||||
// print the value
|
||||
sb->pushChar('\"');
|
||||
// get the json item to print out
|
||||
int32_t vlen = ji->getValueLen();
|
||||
//int32_t vlen = ji->getValueLen();
|
||||
// truncate
|
||||
char *truncStr = NULL;
|
||||
if ( vlen > 32000 ) {
|
||||
@ -8394,7 +8399,7 @@ bool printJsonItemInCSV ( char *json , SafeBuf *sb , State0 *st ) {
|
||||
"JSON to get untruncated data.";
|
||||
}
|
||||
// print it out
|
||||
sb->csvEncode ( ji->getValue() , vlen );
|
||||
sb->csvEncode ( str , vlen ); // ji->getValue() , vlen );
|
||||
// print truncate msg?
|
||||
if ( truncStr ) sb->safeStrcpy ( truncStr );
|
||||
// end the CSV
|
||||
|
Reference in New Issue
Block a user