Fahrenheit to Celsius | °F to °C

Convert Fahrenheit to Celsius

°F

How the Converter Works:

  1. Input:

    • Enter a temperature in Fahrenheit using the input field.
  2. Negate Function:

    • The +/− button toggles the sign of the entered value between positive and negative.
  3. Calculation:

    • When the “Calculate” button is clicked, the convertTemperature() function is called.
    • The formula for Fahrenheit to Celsius conversion is applied: Celsius=(Fahrenheit32)×59\text{Celsius} = (\text{Fahrenheit} – 32) \times \frac{5}{9}
    • The result is displayed in the format: X°F = Y°C, where Y is the temperature in Celsius, rounded to two decimal places.
  4. Clear Button:

    • The “Clear” button resets both the input field and the result display.

Examples:

  1. Example 1:

    • Input: 100 °F
    • Calculation: (10032)×59=37.78°C(100 – 32) \times \frac{5}{9} = 37.78 \, \text{°C}
    • Result: 100°F = 37.78°C
  2. Example 2:

    • Input: 32 °F
    • Calculation: (3232)×59=0°C(32 – 32) \times \frac{5}{9} = 0 \, \text{°C}
    • Result: 32°F = 0°C
  3. Example 3:

    • Input: -40 °F
    • Calculation: (4032)×59=40°C(-40 – 32) \times \frac{5}{9} = -40 \, \text{°C}
    • Result: -40°F = -40°C
Advertisements