// Path: app/src/main/java/com/waynedgrant/cirrus/measures/Pressure.java
// public class Pressure {
//     private BigDecimal hectopascals;
//     private BigDecimal millibars;
//     private BigDecimal kilopascals;
//     private BigDecimal inchesOfMercury;
//     private BigDecimal millimetresOfMercury;
// 
//     public Pressure(BigDecimal hectopascals) {
//         this.hectopascals = hectopascals;
//         this.millibars = hectopascals;
//         this.kilopascals = hectopascals.divide(new BigDecimal("10"), DECIMAL32);
//         this.inchesOfMercury = hectopascals.multiply(new BigDecimal("0.02953"), DECIMAL32);
//         this.millimetresOfMercury = hectopascals.multiply(new BigDecimal("0.750062"), DECIMAL32);
//     }
// 
//     public BigDecimal getValue(PressureUnit unit) {
//         BigDecimal value = null;
// 
//         switch (unit) {
//             case HECTOPASCALS:
//                 value = hectopascals;
//                 break;
//             case MILLIBARS:
//                 value = millibars;
//                 break;
//             case KILIOPASCALS:
//                 value = kilopascals;
//                 break;
//             case INCHES_OF_MERCURY:
//                 value = inchesOfMercury;
//                 break;
//             case MILLIMETRES_OF_MERCURY:
//                 value = millimetresOfMercury;
//                 break;
//         }
// 
//         return value;
//     }
// }
// 
// Path: app/src/main/java/com/waynedgrant/cirrus/units/PressureUnit.java
// public enum PressureUnit {
//     HECTOPASCALS("Hectopascals (hPa)"),
//     INCHES_OF_MERCURY("Inches of Mercury (inHg)"),
//     KILIOPASCALS("Kilopascals (kPa)"),
//     MILLIBARS("Millibars (mb)"),
//     MILLIMETRES_OF_MERCURY("Millimetres of Mercury (mmHg)");
// 
//     private String description;
// 
//     PressureUnit(String description) {
//         this.description = description;
//     }
// 
//     public String toString() {
//         return description;
//     }
// }


import com.waynedgrant.cirrus.measures.Pressure;
import com.waynedgrant.cirrus.units.PressureUnit;
import java.math.RoundingMode;
import java.util.Locale;
import static com.waynedgrant.cirrus.units.PressureUnit.HECTOPASCALS;
import static com.waynedgrant.cirrus.units.PressureUnit.INCHES_OF_MERCURY;
import static com.waynedgrant.cirrus.units.PressureUnit.KILIOPASCALS;
import static com.waynedgrant.cirrus.units.PressureUnit.MILLIBARS;
/* Copyright 2017 Wayne D Grant (www.waynedgrant.com)
   Licensed under the MIT License */

package com.waynedgrant.cirrus.presentation.formatters;




public class PressureFormatter {
    private Pressure pressure;

    public PressureFormatter(Pressure pressure) {
        this.pressure = pressure;
    }

// Path: app/src/main/java/com/waynedgrant/cirrus/measures/Pressure.java
// public class Pressure {
//     private BigDecimal hectopascals;
//     private BigDecimal millibars;
//     private BigDecimal kilopascals;
//     private BigDecimal inchesOfMercury;
//     private BigDecimal millimetresOfMercury;
// 
//     public Pressure(BigDecimal hectopascals) {
//         this.hectopascals = hectopascals;
//         this.millibars = hectopascals;
//         this.kilopascals = hectopascals.divide(new BigDecimal("10"), DECIMAL32);
//         this.inchesOfMercury = hectopascals.multiply(new BigDecimal("0.02953"), DECIMAL32);
//         this.millimetresOfMercury = hectopascals.multiply(new BigDecimal("0.750062"), DECIMAL32);
//     }
// 
//     public BigDecimal getValue(PressureUnit unit) {
//         BigDecimal value = null;
// 
//         switch (unit) {
//             case HECTOPASCALS:
//                 value = hectopascals;
//                 break;
//             case MILLIBARS:
//                 value = millibars;
//                 break;
//             case KILIOPASCALS:
//                 value = kilopascals;
//                 break;
//             case INCHES_OF_MERCURY:
//                 value = inchesOfMercury;
//                 break;
//             case MILLIMETRES_OF_MERCURY:
//                 value = millimetresOfMercury;
//                 break;
//         }
// 
//         return value;
//     }
// }
// 
// Path: app/src/main/java/com/waynedgrant/cirrus/units/PressureUnit.java
// public enum PressureUnit {
//     HECTOPASCALS("Hectopascals (hPa)"),
//     INCHES_OF_MERCURY("Inches of Mercury (inHg)"),
//     KILIOPASCALS("Kilopascals (kPa)"),
//     MILLIBARS("Millibars (mb)"),
//     MILLIMETRES_OF_MERCURY("Millimetres of Mercury (mmHg)");
// 
//     private String description;
// 
//     PressureUnit(String description) {
//         this.description = description;
//     }
// 
//     public String toString() {
//         return description;
//     }
// }


// Path: app/src/main/java/com/waynedgrant/cirrus/presentation/formatters/PressureFormatter.java
import com.waynedgrant.cirrus.measures.Pressure;
import com.waynedgrant.cirrus.units.PressureUnit;
import java.math.RoundingMode;
import java.util.Locale;
import static com.waynedgrant.cirrus.units.PressureUnit.HECTOPASCALS;
import static com.waynedgrant.cirrus.units.PressureUnit.INCHES_OF_MERCURY;
import static com.waynedgrant.cirrus.units.PressureUnit.KILIOPASCALS;
import static com.waynedgrant.cirrus.units.PressureUnit.MILLIBARS;

/* Copyright 2017 Wayne D Grant (www.waynedgrant.com)
   Licensed under the MIT License */

package com.waynedgrant.cirrus.presentation.formatters;




public class PressureFormatter {
    private Pressure pressure;

    public PressureFormatter(Pressure pressure) {
        this.pressure = pressure;
    }

    public String format(PressureUnit unit) {