A tiny cli program to calculate how much money a device will cost in electricity for a given number of days.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
WattsToDollars/README.md

31 lines
1.7 KiB

3 months ago
# watts_to_dollars
A tiny cli program written in Nim to calculate how much money a device will cost in electricity for a given number of days. Written and tested for linux. There may not be anything OS specific, but i haven't paid any attention to that.
3 months ago
# Building from source?
3 months ago
You will need Nim installed, which also contains Nimble, the Nim package manager.
3 months ago
install the termstyle dependency: `nimble install termstyle`
3 months ago
compile watts_to_dollars.nim with: `nim c --d:threads:off -d:release --opt:speed watts_to_dollars.nim`
3 months ago
copy the binary to `~/.local/bin` and make it executable.
3 months ago
run the program from any location in the terminal with: `./watts_to_dollars`
# OR Just Download and Run the binary
Download `watts_to_dollars_x86_64_linux_bin`
3 months ago
Rename it if you want and copy it to `~/.local/bin`
3 months ago
run the program from any location in the terminal with: `./watts_to_dollars` or whatever you renamed it.
# How To Use
3 months ago
The idea is to enter the total watts of a device, or the difference in watts between two devices, if you want to see how much those watts will cost you on your electricity bill. It uses days as the time unit for simplicity, so you can use `31` for a month or `365` for a year if you want to.
# But Why?
3 months ago
I often need this information, and doing a search for a website with reams of nonsensical text and possibly not even finding a calculator, or finding one that irritates me, finally took it's toll yesterday morning, and i wrote this instead. I thought maybe other people might find it useful, thus the repo. This was also the first time i had a good enough excuse to write something in Nim for the CLI, and i liked how clean and concise it turned out, and thought someone else might like to see a small example.
Enjoy!