Skip to content

Lateralus138/TemperatureConvert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Temperature Convert Temperature Convert Logo

Readme Card



About

All files can be found on the Releases page.

Description

This Windows command line utility helps to convert Fahrenheit temperatures to Celsius and vice versa with a few options.

Motivation

I like to provide both temperature types in my weather outputs in various environments (espcially from the command line) and this provides an alternate method rather than always using functions.


Usage

Environment

This is a Windows command line tool for CMD and PowerShell. There are both x86 (32 bit) and x64 (64 bit) versions of the executable.

How To Use

The programs assumes input is Fahrenheit and the result is returned in Celsius (please forgive me, but I'm American and I had to choose one or the other and I, more often than not, need to find out what the Celsius result is).

To return the result in Fahrenheit you can pass the /f or /fahrenheit switch the program (/c or /celsius is provided for completeness/to override a passed '/f' switch if a change is branched in a script or something).

The converted result is returned as an integer or float (with 2 decimal places) value and if it's a float the you can set the precision (width) of the decimal with the /w or /width parameter (e.g. /w 0 or /width 8).

The converted value only returns a number, but the temperature type ('C' or 'F') can be appended to the result with the /s or /symbol switch.

As with any portable program this can be placed anywhere you like on your machine, but more preferably in a directory that is in your %PATH% environment variable so you can run it without a full path (tempconvert for example). I recommend using a dedicated Bin directory, but of course, it's your choice. If your path isn't already in your %PATH% environment then I suggest adding it[1], but if not then you have provide the full path (C:\Path\To\tempconvert.exe for example) when executing the program.

Examples

Get help:

PS> tempconvert /?

Temperature Convert -  Convert Fahrenheit to Celsius
                       and vice versa. Defaults from
                       Celsius to Fahrenheit.

tempconvert  [/? | /h | /help] | [<temperature> &|
  [/t | /temperature]] [/c | /celsius]
  [/f | /fahrenheit] [/s | /symbol]
  [[/w | /width] <decimal width>]

  Temperature       Integer, float, or double float
                    temperature value. 
  /?, /h, /help     This help screen.
  /t, /temperature  Alternate method of providing
                    the temperature.
  /c, /celsius      Temperature is assumed
                    Fahrenheit and returns a Celsius
  /f, /fahrenheit   Temperature is assumed Celsius
                    and returns a Fahrenheit value.
  /s, /symbol       Appends 'F' or 'C' character to
                    the result.
  /w, /width        Width of any trailing decimal.
                    Defaults to 2; range from 0-15.

Convert Fahrenheit to Celsius (assumes input is Fahrenheit):

PS> tempconvert 69
20.56

Convert Fahrenheit to Celsius formatted with a symbol:

PS> tempconvert 69 /symbol
20.56C

Convert Fahrenheit to Celsius formatted with a symbol and a decimal width of 0 (rounded):

PS> tempconvert 69 /s /w 0
21C

Project Information

This project is written in C++.

C++

Source File Quality

This is graded by CodeFactor and is subjective, but helps me to refactor my work.

Name Status
codefactor.io

File MD5 Hashes

All hashes are retrieved at compile/build time.

Current Windows X86 MD5

WINDOWS X86 MD5

Current Windows X64 MD5

WINDOWS X64 MD5

Other Miscellaneous File Information

Description Status
Project Release Date GitHub Release Date
Total downloads for this project GitHub all releases
Complete repository size This Repo Size
Commits in last month GitHub commit activity
Commits in last year GitHub commit activity

Notes

Note 1

Adding a path to the Windows %PATH% environment variable @ DuckDuckGo


Media

Logo

Logo

Help

Help

Convert F to C with a temp symbol

Example1


Support Me If You Like

If you like any of the projects below and care to donate to my PayPal:

PayPal Donation

Or Buy Me A Coffee if your prefer:

Buy Me A Coffee


License Info

License Excerpt
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.

About

Convert Fahrenheit to Celsius and vice versa from the command line.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages