A simple little utility to convert any decimal, hex, or binary number to the other representations.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-05-16 15:05:53 -06:00
go.mod change go module 2025-05-16 15:05:53 -06:00
LICENSE Create LICENSE 2025-05-16 14:46:13 -06:00
main.go add readme, add tests, move convert to its own func 2025-05-16 15:01:47 -06:00
main_test.go add readme, add tests, move convert to its own func 2025-05-16 15:01:47 -06:00
README.md add readme, add tests, move convert to its own func 2025-05-16 15:01:47 -06:00

num-conv

A simple little utility to convert any decimal, hex, or binary number to the other representations.

I made this for a class where we regularly had to convert numbers between different bases, and I wanted a quick way to check my work.

Usage

Clone source

git clone https://github.com/dickeyy/num-conv
cd num-conv
go run main.go <number>

Install binary

go install github.com/dickeyy/num-conv@latest
num-conv <number>

For number, you can use decimal (positive, negative, or fractional), hex, or binary.

num-conv 0xAFB
num-conv 0b10010
num-conv 12
num-conv -12
num-conv 12.34
num-conv -12.34

License

Licensed under the MIT License. See the LICENSE file for details.