StackExchange / StackExchange/StackExchange.Redis
Storing decimal values in redis
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.2k
- Forks
- 1.6k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 43
Description
When I have to store decimals I convert them to a string in order to be able to use stack exchange API.
In the parsing method, there is no case for decimals. Is there a specific reason for it or it is a bug.
internal static RedisValue TryParse(object? obj, out bool valid)
{
valid = true;
switch (obj)
{
case null: return Null;
case string v: return v;
case int v: return v;
case uint v: return v;
case double v: return v;
case byte[] v: return v;
case bool v: return v;
case long v: return v;
case ulong v: return v;
case float v: return v;
case ReadOnlyMemory<byte> v: return v;
case Memory<byte> v: return v;
case RedisValue v: return v;
default:
valid = false;
return Null;
}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the internal TryParse(object? obj, out bool valid) method shown in the issue and review how supported numeric values are converted to RedisValue. Confirm the intended decimal behavior with the project’s existing tests or test structure; done means decimal values can be stored without requiring callers to convert them to strings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, redis
- Domain
- database
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100