Forum Post: RE: merging json objects

Status
Not open for further replies.
H

Håvard Danielsen

Guest
You can use AddNumber as follows: when JsonDataType:NUMBER then pcTarget:AddNumber(cNames,string(pcSource:GetDecimal(cNames))). Note that this will remove any unnecessary decimals (2.0 will be output as 2). .If you want to keep the decimal delimiter also when it is 0 you would need to read as integer or int64 first and use decimal if it fails: when JsonDataType:NUMBER then do: intval = ?. intval = pcSource:GetInt64(cNames) no-error. if intval ? then pcTarget:Add(cNames,intval). else pcTarget:Add(cNames,pcSource:GetDecimal(cNames)). end. --

Continue reading...
 
Status
Not open for further replies.
Top