|
|
|
@ -11,21 +11,28 @@ import java.util.Map; |
|
|
|
|
|
|
|
/** |
|
|
|
* 单位换算工具 |
|
|
|
* @author HanLong |
|
|
|
*/ |
|
|
|
public class CalUnitTools { |
|
|
|
|
|
|
|
private static String[] unitList = {"pL", "nL", "uL", "mL", "L"}; |
|
|
|
|
|
|
|
// 定义单位换算基准(以升L为基准单位) |
|
|
|
/** |
|
|
|
* 定义单位换算基准(以升L为基准单位) |
|
|
|
*/ |
|
|
|
private static final Map<String, BigDecimal> UNIT_TO_LITER = new HashMap<>(); |
|
|
|
|
|
|
|
static { |
|
|
|
// 初始化单位换算关系 |
|
|
|
UNIT_TO_LITER.put("L", new BigDecimal("1.0")); |
|
|
|
UNIT_TO_LITER.put("mL", new BigDecimal("0.001")); // 毫升 |
|
|
|
UNIT_TO_LITER.put("uL", new BigDecimal("0.000001")); // 微升 (μL,这里用uL代替) |
|
|
|
UNIT_TO_LITER.put("nL", new BigDecimal("0.000000001")); // 纳升 |
|
|
|
UNIT_TO_LITER.put("pL", new BigDecimal("0.000000000001")); // 皮升 |
|
|
|
// 毫升 |
|
|
|
UNIT_TO_LITER.put("mL", new BigDecimal("0.001")); |
|
|
|
// 微升 (μL,这里用uL代替) |
|
|
|
UNIT_TO_LITER.put("uL", new BigDecimal("0.000001")); |
|
|
|
// 纳升 |
|
|
|
UNIT_TO_LITER.put("nL", new BigDecimal("0.000000001")); |
|
|
|
// 皮升 |
|
|
|
UNIT_TO_LITER.put("pL", new BigDecimal("0.000000000001")); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|