code: public static MetricValue valueOf(BigDecimal val, final String format) {
          if (val instanceof MetricValue) {
              // TODO: check that val.format == format
              return (MetricValue) val;
          }
          return new MetricValue(val, new DecimalFormat(format));
      }
docs: Returns the MetricValue representation of the passed in BigDecimal.
  If <code>val</code> is already a {@link MetricValue} object, val is returned.
  
  WARNING: as of this version, no check is performed that the passed in value format, if a {@link MetricValue},
  is equal to <code>format</code>
  @param val value to be converted
  @param format format of the resulting output
  @return the converted value