MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / SIValue_FromString

Function SIValue_FromString

src/value.c:395–409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

393}
394
395SIValue SIValue_FromString(const char *s) {
396 char *sEnd = NULL;
397
398 errno = 0;
399 double parsedval = strtod(s, &sEnd);
400 // the input was not a complete number or represented a number that
401 // cannot be represented as a double
402 // create a string SIValue
403 if(sEnd[0] != '\0' || errno == ERANGE) {
404 return SI_DuplicateStringVal(s);
405 }
406
407 // The input was fully converted; create a double SIValue.
408 return SI_DoubleVal(parsedval);
409}
410
411size_t SIValue_StringJoinLen(SIValue *strings, unsigned int string_count, const char *delimiter) {
412 size_t length = 0;

Callers 2

test_numericsFunction · 0.85
test_stringsFunction · 0.85

Calls 2

SI_DuplicateStringValFunction · 0.85
SI_DoubleValFunction · 0.85

Tested by 2

test_numericsFunction · 0.68
test_stringsFunction · 0.68