Newer
Older
unit-converter / src / main / java / com / ljunggren / unitConversion / volume / units / us / Pint.java
@aljunggren aljunggren on 4 Jun 2021 577 bytes Added Quart and Pint
package com.ljunggren.unitConversion.volume.units.us;

import java.util.function.Function;

import com.ljunggren.unitConversion.System;
import com.ljunggren.unitConversion.volume.Volume;

public class Pint implements Volume {

    @Override
    public Function<Double, Double> toBaseUnit() {
        return x -> x * 16;
    }

    @Override
    public Function<Double, Double> fromBaseUnit() {
        return x -> x / 16;
    }

    @Override
    public System system() {
        return System.US;
    }

    @Override
    public String label() {
        return "pt";
    }

}