Thetype exposes the following members.
Constructs a Temperature with the specified units and value (rounded to the nearest 0.1 degrees).
Returns true if this temperature has Celsius units.
Returns true if this temperature has Fahrenheit units.
Gets the unit of this temperature.
Returns a double representation of the 0.1 precision number stored internally.
Returns a Temperature with the specified Celsius temperature rounded to the nearest 0.1 C.
Two Temperature instances can only be equal if they have the same units and temperature value.(Overrides ValueTypeEquals(Object).)
Two Temperature instances can only be equal if they have the same units and temperature value.
Returns a Temperature with the specified Fahrenheit temperature rounded to the nearest 0.1 F.
Overridden to ensure consistency with Equals.(Overrides ValueTypeGetHashCode.)
Returns a non-null, non-empty string representation of the numeric base-temperature value, like "50" or "15.5" or "-5" or "33.1", in a format suitable for insertion into the appropriate unit-specific element(s) of the request XML.
Returns a non-null, non-empty string representation of this instance for logging and debugging purposes.(Overrides ValueTypeToString.)
Determines whether two specified Temperature instances are equal.
Determines whether two specified Temperature instances are not equal.
Temperature celsiusTemp = Temperature.Celsius(15.5); Temperature fahrenheitTemp = Temperature.Fahrenheit(65);
Dim celsiusTemp As Temperature = Temperature.Celsius(15.5) Dim fahrenheitTemp As Temperature = Temperature.Fahrenheit(65)
You can pass a temperature into a Calculation to define the base temperature that that Calculation should use to calculate degree days. Use a Celsius temperature for Celsius degree days, and a Fahrenheit temperature for Fahrenheit degree days.
This class enables temperatures to be defined to the nearest 0.1 degrees (either 0.1 C or 0.1 F). Given the limitations of temperature-recording equipment and methods, it is meaningless to consider temperature differences smaller than this.
When creating a Temperature object, you can pass in any double value within the maximum and minimum limits set by the temperature unit. But the value you pass in will always be rounded to the nearest 0.1 degrees.
For example, a Celsius Temperature created with a value of 15.5 will be equal to one created with 15.456 or 15.543. And a Fahrenheit Temperature created with 65 will be equal to one created with 64.96 or 65.04.
One benefit of this is that you can easily define a range of base temperatures in a loop without worrying too much about the inaccuracies of floating-point arithmetic. The automatic rounding should correct any such issues (e.g. rounding 69.9998 up to 70).