code: protected Float convertFloat(String value, String unit, int unary)
  			throws IllegalArgumentException {
  
  		try {
              if (unit != null)
              {
      			// trim & lowercase
      			value = value.trim().toLowerCase();
      			// trim units from value
                  if (value.endsWith(unit))
                      value = value.substring(0, value.length() - unit.length());
              }
  
  			return Float.parseFloat(value) * unary;
  		} catch (NumberFormatException e) {
  			throw new IllegalArgumentException(
  					"Invalid number format " + value, e);
  		} catch (NullPointerException e) {
  			throw new IllegalArgumentException("Invalid null format");
  		}
  	}
docs: **********************************************************************
  HELPERS *
  **********************************************************************