The default addReplyDouble has too much accuracy. We use this * for returning location distances. "5.2145 meters away" is nicer * than "5.2144992818115 meters away." We provide 4 digits after the dot * so that the returned value is decently accurate even when the unit is * the kilometer. */
| 204 | * so that the returned value is decently accurate even when the unit is |
| 205 | * the kilometer. */ |
| 206 | void addReplyDoubleDistance(client *c, double d) { |
| 207 | char dbuf[128]; |
| 208 | int dlen = snprintf(dbuf, sizeof(dbuf), "%.4f", d); |
| 209 | addReplyBulkCBuffer(c, dbuf, dlen); |
| 210 | } |
| 211 | |
| 212 | /* Helper function for geoGetPointsInRange(): given a sorted set score |
| 213 | * representing a point, and a GeoShape, appends this entry as a geoPoint |
no test coverage detected