fahrenheit To Celsius, celsius To Fahrenheit : Integer « Date Type « Android

fahrenheit To Celsius, celsius To Fahrenheit

 class WeatherUtils {
  public static int fahrenheitToCelsius(int tFahrenheit) {
    return (int) ((5.0f / 9.0f) * (tFahrenheit - 32));

  public static int celsiusToFahrenheit(int tCelsius) {
    return (int) ((9.0f / 5.0f) * tCelsius + 32);


Related examples in the same category

1.Integer To One Byte
2.Integer To Two Bytes
3.Integer To Four Bytes
4.One Byte To Integer
5.Two Bytes To Integer
6.List to int[]
7.Tests if an integer is power of two
8.Convert an integer value to its byte array representation
9.Convert a byte array integer (4 bytes) to its int value
10.Convert a byte array representing an unsigned integer (4bytes) to its long value
11.Padding Int value