add float

This commit is contained in:
Dennis Eichhorn 2019-12-08 08:48:22 +01:00
parent 0fd5a91a2e
commit 221bc5b2cb

View File

@ -278,6 +278,8 @@ class RedisCache extends ConnectionAbstract
{ {
if ($type === CacheValueType::_INT || $type === CacheValueType::_STRING || $type === CacheValueType::_BOOL) { if ($type === CacheValueType::_INT || $type === CacheValueType::_STRING || $type === CacheValueType::_BOOL) {
return (string) $value; return (string) $value;
} elseif ($type === CacheValueType::_FLOAT) {
return \rtrim(\rtrim(\number_format($value, 5, '.', ''), '0'), '.');
} elseif ($type === CacheValueType::_ARRAY) { } elseif ($type === CacheValueType::_ARRAY) {
return (string) \json_encode($value); return (string) \json_encode($value);
} elseif ($type === CacheValueType::_SERIALIZABLE) { } elseif ($type === CacheValueType::_SERIALIZABLE) {