Options
All
  • Public
  • Public/Protected
  • All
Menu

This class converts the value to fahrenheit.

Hierarchy

  • UnitConverter

Index

Constructors

Properties

Methods

Constructors

constructor

  • new UnitConverter(convertedTemp: number, convertedUnit: string): UnitConverter
  • This constructor gets the temperature and the unit from other classes to convert.

    Parameters

    • convertedTemp: number

      stores the temperature from other class in this.convertedTemp.

    • convertedUnit: string

      stores the unit from other class in this.convertedUnit.

    Returns UnitConverter

Properties

convertedTemp

convertedTemp: number

convertedUnit

convertedUnit: string

Methods

getUnit

  • getUnit(): number
  • This class gets the new temperature and new unit and checks if they are in fahrenheit, celsius, kelvin. If the new unit is in fahrenheit it will not convet. But if the unit is celsius or kelvin it wil convert.

    Returns number

    returns the converted temperature.

Generated using TypeDoc