Crates.io | tempr |
lib.rs | tempr |
version | 1.2.0 |
source | src |
created_at | 2024-05-14 18:35:14.914216 |
updated_at | 2024-05-19 20:53:50.554005 |
description | A fast, command-line fahrenheit to celcius converter |
homepage | |
repository | https://git.sr.ht/~sramsay/tempr |
max_upload_size | |
id | 1239907 |
size | 58,169 |
Version 1.2.0
Probably not.
It's a command-line program for UNIX-like systems that converts from Fahrenheit to Celsius and vice versa. So if you type:
$ tempr 23
It will give you:
23.0°F is -5.0°C
23.0°C is 73.4°F
You can also adjust the precision with the --precision switch, so that:
$ tempr --precision=3 -320.4
gives you:
-320.400°F is -195.778°C
-320.400°C is -544.720°F
The default precision is 1.
Yes.
Like many Americans, I am mostly illiterate when it comes to the metric system. It often happens, though, that I'm in a chatroom or something and one of my friends (who is living in some exotic locale like Ottawa) will say, "It's -4 degrees outside!" Which sounds insanely cold to me. But armed with tempr
, I can say, "Cry me a river. That's not that cold."
This program is written in Rust, so you need a Rust compiler installed on your machine.
Assuming you have that taken care of, it'll be something like this:
$ cargo install tempr
Exactly where that installs the binary depends on your local configuration, but cargo
is pretty clever, and can probably put it anywhere you like.
Yes. I mostly use this project to play around with different languages, build tools, linters, and continuous integration systems before I recklessly incorporate them into larger projects.
And this particular problem is actually trickier than it looks, because when you type:
$ tempr -28
on the command line, UNIX-like systems assume that you must be trying to pass the tempr
program some kind of weird option (maybe the -2
and -8
options smashed together?). Getting around that without exotic dependencies requires . . . hacking a solution (though for the record, I've never seen a system handle this more gracefully than Rust).
Oh, and tempr proved very useful when building nowa, which is a much more interesting and useful program.
Probably.
Probably.
Probably not.
How long must I endure you people?
Yeah, it'd probably be cool. On the other hand, my friends were all humanities majors, so when they say, "It's 10 degrees!" they are definitely not talking about some substance being miraculously held at -263.15°C.
And why stop there? What about the Rankine scale? Or Isaac Newton's scale (devised in 1701) by which one may speak of the Calor aeris hyberni ubi aqua incipit gelu rigescere ("the heat of air in winter at which water begins to freeze"). My humanities friends are, after all, way better at Latin.
I don't know. Maybe version 2.
Nah, I think the metric system is way more rational, and it's the system used by most people the world over. I wish we (Americans, Libyans, Belizeans, and Myanmars) would switch. There's perhaps some hope for those last three, but the first seem curiously intractable on this point.
tempr
is written and maintained by Stephen Ramsay (sramsay{at}protonmail{dot}com).
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Last Modified: 2024-05-19T15:53:32:-0500