Here you can find the source of formatToastTemp(String message, int value, String unit)
public static String formatToastTemp(String message, int value, String unit)
//package com.java2s; public class Main { public static String formatToastTemp(String message, int value, String unit) {/*from ww w .j a va 2 s.c o m*/ if (unit.equals("c")) message += ": " + value + "?C"; else message += ":" + CelciusToFahrenheit(value) + "?F"; return message; } public static int CelciusToFahrenheit(int temp) { double fahr = temp * 9 / 5 + 32; return (int) fahr; } }