MCPcopy Create free account
hub / github.com/F-Stack/f-stack / RM_CreateStringFromLongDouble

Function RM_CreateStringFromLongDouble

app/redis-6.2.6/src/module.c:1192–1197  ·  view source on GitHub ↗

Like RedisModule_CreatString(), but creates a string starting from a long * double. * * The returned string must be released with RedisModule_FreeString() or by * enabling automatic memory management. * * The passed context 'ctx' may be NULL if necessary, see the * RedisModule_CreateString() documentation for more info. */

Source from the content-addressed store, hash-verified

1190 * The passed context 'ctx' may be NULL if necessary, see the
1191 * RedisModule_CreateString() documentation for more info. */
1192RedisModuleString *RM_CreateStringFromLongDouble(RedisModuleCtx *ctx, long double ld, int humanfriendly) {
1193 char buf[MAX_LONG_DOUBLE_CHARS];
1194 size_t len = ld2string(buf,sizeof(buf),ld,
1195 (humanfriendly ? LD_STR_HUMAN : LD_STR_AUTO));
1196 return RM_CreateString(ctx,buf,len);
1197}
1198
1199/* Like RedisModule_CreatString(), but creates a string starting from another
1200 * RedisModuleString.

Callers

nothing calls this directly

Calls 2

ld2stringFunction · 0.85
RM_CreateStringFunction · 0.85

Tested by

no test coverage detected