Feature request: Hex with two's complement
- Dominant language
- JavaScript
- Stars
- 35.8k
- Forks
- 4.1k
- Avg merge
- 2d 26m
- Merged PRs (30d)
- 33
Description
**Is your feature request related to a problem? Please describe.**
I have some data with strings like `-16777216`, that can be converted to hex as `-FF0100`. But for the sign, we can apply [Two's complements](https://en.wikipedia.org/wiki/Two%27s_complement) to display hex signed 2's complement `FF00FF00` like here: https://www.rapidtables.com/convert/number/decimal-to-hex.html
**Describe the solution you'd like**
See above.
**Describe alternatives you've considered**
https://www.rapidtables.com/convert/number/decimal-to-hex.html
**Additional context**
Sorry, the JSON is from an internal project.
Thanks!
Contributor guide
Research direction
No files or tests are named in the issue. Start by locating the existing decimal-to-hex conversion entry point and inspect how negative values and output width are handled. Clarify the intended two's-complement width and add coverage showing the requested result for -16777216; done means the behavior is documented and tested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100