app/src/main/java/com/example/android/sunshine/app/ForecastFragment.java
/**
         * Prepare the weather high/lows for presentation.
         */
Prepare the weather high/lows for presentation.
Prepare the weather high / lows for presentation .
private String formatHighLows(double high, double low, String unitType) {
            if(unitType.equals(getString(R.string.pref_units_imperial))) {
                high = (high * 1.8) + 32;
                low = (low * 1.8) + 32;
            } else if (!unitType.equals(getString(R.string.pref_units_metric))) {
                Log.d(LOG_TAG, "Unit Type not found: " + unitType);
            }
            long roundedHigh = Math.round(high);
            long roundedLow = Math.round(low);
            String highLowStr = roundedHigh + "/" + roundedLow;
            return highLowStr;
        }
private String formatHighLows ( double high , double low , String unitType ) { if ( unitType . equals ( getString ( R . string . pref_units_imperial ) ) ) { high = ( high * 1.8 ) + 32 ; low = ( low * 1.8 ) + 32 ; } else if ( ! unitType . equals ( getString ( R . string . pref_units_metric ) ) ) { Log . d ( LOG_TAG , "Unit Type not found: " + unitType ) ; } long roundedHigh = Math . round ( high ) ; long roundedLow = Math . round ( low ) ; String highLowStr = roundedHigh + "/" + roundedLow ; return highLowStr ; }
Prepare the weather high/lows for presentation.
Prepare the weather high / lows for presentation .
// For presentation, assume the user doesn't care about tenths of a degree.