mirror of
https://github.com/fluencelabs/redis
synced 2025-03-18 16:40:50 +00:00
addReplyHumanLongDouble() API added.
Send a long double or double as a bulk reply, in a human friendly format.
This commit is contained in:
parent
f4befcc0ff
commit
cf42c48adc
@ -455,6 +455,15 @@ void addReplyDouble(client *c, double d) {
|
||||
}
|
||||
}
|
||||
|
||||
/* Add a long double as a bulk reply, but uses a human readable formatting
|
||||
* of the double instead of exposing the crude behavior of doubles to the
|
||||
* dear user. */
|
||||
void addReplyHumanLongDouble(client *c, long double d) {
|
||||
robj *o = createStringObjectFromLongDouble(d,1);
|
||||
addReplyBulk(c,o);
|
||||
decrRefCount(o);
|
||||
}
|
||||
|
||||
/* Add a long long as integer reply or bulk len / multi bulk count.
|
||||
* Basically this is used to output <prefix><long long><crlf>. */
|
||||
void addReplyLongLongWithPrefix(client *c, long long ll, char prefix) {
|
||||
|
@ -1123,6 +1123,7 @@ void addReplyBulkSds(client *c, sds s);
|
||||
void addReplyError(client *c, const char *err);
|
||||
void addReplyStatus(client *c, const char *status);
|
||||
void addReplyDouble(client *c, double d);
|
||||
void addReplyHumanLongDouble(client *c, long double d);
|
||||
void addReplyLongLong(client *c, long long ll);
|
||||
void addReplyMultiBulkLen(client *c, long length);
|
||||
void copyClientOutputBuffer(client *dst, client *src);
|
||||
|
Loading…
x
Reference in New Issue
Block a user