Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

t - Temperature Display

May
366
4
I work with a lot of people who use Celsius and this helps the small talk at the front of the meeting. Just give it a temperature number and it will show what that is in both Fahrenheit and Celsius.

This also used my @Round function. Here is that code (and thanks Vince for helping me out on it.)
Code:
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Round [NumberToRound,Percision]
:: Setting the number equal to another sets the precision past the decimal point.
:: See https://jpsoft.com/forums/threads/quick-function-question.8729/
:: Not sure I understand how this works...seems like magic to me.
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Round = %@Eval[%1=%2]
Code:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Command: t
:: March 2016
::
:: Library command that takes a number and displays the temps
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
t {
    :: If we don't have an argument, display usage and quit
    iff "%1"=="" then
        echo Usage:  T TemperatureNumber
        quit
    endiff

    :: Process F
    set Result=%@Eval[(%1 - 32) * (5/9)]
    echo %1F = %@Round[%Result,0]C

    :: Process C
    set Result=%@Eval[(%1 * (9/5)) + 32]
    echo %1C = %@Round[%Result,0]F

    :EndProgram
    unset Result
}
 
Back
Top