BullyWiiHacks
Welcome dear guest! Very Happy

To start posting and being part of the BWH community, you simply need to register an account or log into an existing one.

If you do not wish to register at all, that's fine but there will be more advertisements. :/

You can probably see and download most content provided for regular members even without an account.

Your contributions will be greatly appreciated though, give it a shot and register today! thumbsup

Join the forum, it's quick and easy

BullyWiiHacks
Welcome dear guest! Very Happy

To start posting and being part of the BWH community, you simply need to register an account or log into an existing one.

If you do not wish to register at all, that's fine but there will be more advertisements. :/

You can probably see and download most content provided for regular members even without an account.

Your contributions will be greatly appreciated though, give it a shot and register today! thumbsup
BullyWiiHacks
Would you like to react to this message? Create an account in a few clicks or log in to continue.
BullyWiiHacks

Gaming, Modding & Programming

Important reminders:

- Click *HERE* for advanced forum search or check out the text field below on the front page for Google before posting
- NO support via private message (use the forum)
- Write meaningful topic titles
Site Translation
Latest topics
» Dropped Out of College to Pursue Web Dev and Life Pursuits in General
Converting Fahrenheit <-> Celsius Manually & w/ JavaScript Empty4/7/2024, 2:34 pm by SnB@BWH

» Bully Made It Into a BIG Video 400K Views
Converting Fahrenheit <-> Celsius Manually & w/ JavaScript Empty4/7/2024, 6:58 am by Bully@WiiPlaza

» Wii Play Tanks
Converting Fahrenheit <-> Celsius Manually & w/ JavaScript Empty3/24/2024, 2:46 pm by helpmeout

» [Bypass Paywalls] (Global) @magnolia1234 - GitLab
Converting Fahrenheit <-> Celsius Manually & w/ JavaScript Empty3/18/2024, 3:55 am by Seth@WiiPlaza

» [Download] Mary Shelley's Frankenhole
Converting Fahrenheit <-> Celsius Manually & w/ JavaScript Empty3/16/2024, 8:29 am by Seth@WiiPlaza

» Completely Custom Modded Controllers (Undetectable)
Converting Fahrenheit <-> Celsius Manually & w/ JavaScript Empty3/5/2024, 1:55 pm by Shadow@BWH

» (Zombies) Drink perks code?
Converting Fahrenheit <-> Celsius Manually & w/ JavaScript Empty3/5/2024, 1:24 pm by Shadow@BWH

» Die Rückkehr zu STEAM und WARFACE
Converting Fahrenheit <-> Celsius Manually & w/ JavaScript Empty3/2/2024, 3:54 am by Seth@WiiPlaza

» First person hand model change?
Converting Fahrenheit <-> Celsius Manually & w/ JavaScript Empty2/28/2024, 4:53 am by Ad3lamac611

» {RELEASE} Field Raider Firefox v1.72 by Seth@WiiPlaza
Converting Fahrenheit <-> Celsius Manually & w/ JavaScript Empty2/21/2024, 8:52 am by naxil

Search
 
 

Display results as :
 


Rechercher Advanced Search

May 2024
MonTueWedThuFriSatSun
  12345
6789101112
13141516171819
20212223242526
2728293031  

Calendar Calendar

Country Statistics
Free counters!

You are not connected. Please login or register

Converting Fahrenheit <-> Celsius Manually & w/ JavaScript

2 posters

Go down  Message [Page 1 of 1]

SnB@BWH

SnB@BWH
Admin & Writer

Have you ever wondered what the temperature is, but instead it tells you in the wrong type and you don't know what it is, so you have to look it up? Well, after reading this, you won't have to. You'll hopefully be able to do it in your head.


To convert Celsius to Fahrenheit use the following formula.

Multiply the temperature by 9.
Divide the number you got by 5.
Then add 32.

To convert Fahrenheit to Celsius use the following formula.

Subtract 32 from the temperature.
Multiply that number by 5.
Then divide that number by 9. 

But what if you were too lazy to convert it in your head? You can use a programming language such as JavaScript to do the conversion for you.

Code:

var celsius = 30;
var celsiusInF = (celsius*9)/5 + 32;
console.log(celsius + '°C is ' + celsiusInF + '°F');
var fahrenheit = 20;
var fahrenheitInC = ((fahrenheit - 32)*5)/9;
console.log(fahrenheit + '°F is ' + fahrenheitInC + '°C');

If you were to type that code into a JavaScvript console, it will output the following.

Converting Fahrenheit <-> Celsius Manually & w/ JavaScript Screen17

I'm sure if you were in Grade 3, you'd know how the mathematical formula works, but you might not understand how the JavaScript code works. So, let me break it down for you.

Code:
var


Stands for variable. A variable is used to store a value and use it for later.

Code:
var celsiusInF = (celsius*9)/5 + 32;

Means that the value used in the variable "celsius" is multiplied by 9. That number is then divided by 5 and then added with 32.

Code:
console.log

Means to output a value, such as a string, an answer to an equation or both. For this, it's both.

Code:
console.log(celsius + '°C is ' + celsiusInF + '°F');

Means to output the value of the variable celsius, add the string "°C is ", add the value of the variable celsiusInF, then finally add the string "°F". By "add" I mean to add together not to use addition!

The output will be "30°C is 86°F", provided that you used 30°C as the value for the variable "celsius".

There you go! I hope you learned something!  Smile


_________________
Converting Fahrenheit <-> Celsius Manually & w/ JavaScript Simple10

Converting Fahrenheit <-> Celsius Manually & w/ JavaScript LSTjSyDDiscord: SnB_BWH

Click HERE to earn free bitcoin, litecoin, dogecoin, and dash!

Win Free Bitcoins every hour!

Bully@WiiPlaza

Bully@WiiPlaza
 
 

Great stuff!

The JavaScript console can be found in the Chrome developer tools for example.

Converting Fahrenheit <-> Celsius Manually & w/ JavaScript Chrome10


_________________
Converting Fahrenheit <-> Celsius Manually & w/ JavaScript YBjg74I

Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum