MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / RM_CreateStringFromLongDouble

Function RM_CreateStringFromLongDouble

src/module.cpp:1219–1224  ·  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

1217 * The passed context 'ctx' may be NULL if necessary, see the
1218 * RedisModule_CreateString() documentation for more info. */
1219RedisModuleString *RM_CreateStringFromLongDouble(RedisModuleCtx *ctx, long double ld, int humanfriendly) {
1220 char buf[MAX_LONG_DOUBLE_CHARS];
1221 size_t len = ld2string(buf,sizeof(buf),ld,
1222 (humanfriendly ? LD_STR_HUMAN : LD_STR_AUTO));
1223 return RM_CreateString(ctx,buf,len);
1224}
1225
1226/* Like RedisModule_CreatString(), but creates a string starting from another
1227 * RedisModuleString.

Callers

nothing calls this directly

Calls 2

ld2stringFunction · 0.85
RM_CreateStringFunction · 0.85

Tested by

no test coverage detected