Like RedisModule_CreatString(), but creates a string starting from a double * instead of taking a buffer and its length. * * The returned string must be released with RedisModule_FreeString() or by * enabling automatic memory management. */
| 1203 | * The returned string must be released with RedisModule_FreeString() or by |
| 1204 | * enabling automatic memory management. */ |
| 1205 | RedisModuleString *RM_CreateStringFromDouble(RedisModuleCtx *ctx, double d) { |
| 1206 | char buf[128]; |
| 1207 | size_t len = d2string(buf,sizeof(buf),d); |
| 1208 | return RM_CreateString(ctx,buf,len); |
| 1209 | } |
| 1210 | |
| 1211 | /* Like RedisModule_CreatString(), but creates a string starting from a long |
| 1212 | * double. |
nothing calls this directly
no test coverage detected