code: function(measurement) {
      const unitDefinitions = this.options.units;
  
      return {
        lengthDisplay: buildDisplay(
          measurement.length,
          this.options.primaryLengthUnit,
          this.options.secondaryLengthUnit,
          this.options.decPoint,
          this.options.thousandsSep
        ),
        areaDisplay: buildDisplay(
          measurement.area,
          this.options.primaryAreaUnit,
          this.options.secondaryAreaUnit,
          this.options.decPoint,
          this.options.thousandsSep
        )
      };
  
      function buildDisplay(val, primaryUnit, secondaryUnit, decPoint, thousandsSep) {
        if (primaryUnit && unitDefinitions[primaryUnit]) {
          let display = formatMeasure(val, unitDefinitions[primaryUnit], decPoint, thousandsSep);
          if (secondaryUnit && unitDefinitions[secondaryUnit]) {
            const formatted = formatMeasure(
              val,
              unitDefinitions[secondaryUnit],
              decPoint,
              thousandsSep
            );
            display = `${display} (${formatted})`;
          }
          return display;
        }
        return formatMeasure(val, null, decPoint, thousandsSep);
      }
  
      function formatMeasure(val, unit, decPoint, thousandsSep) {
        const unitDisplays = {
          acres: __('acres'),
          feet: __('feet'),
          kilometers: __('kilometers'),
          hectares: __('hectares'),
          meters: __('meters'),
          miles: __('miles'),
          sqfeet: __('sqfeet'),
          sqmeters: __('sqmeters'),
          sqmiles: __('sqmiles')
        };
  
        const u = L.extend({ factor: 1, decimals: 0 }, unit);
        const formattedNumber = numberFormat(
          val * u.factor,
          u.decimals,
          decPoint || __('decPoint'),
          thousandsSep || __('thousandsSep')
        );
        const label = unitDisplays[u.display] || u.display;
        return [formattedNumber, label].join(' ');
      }
    }
docs: format measurements to nice display string based on units in options `{ lengthDisplay: '100 Feet (0.02 Miles)', areaDisplay: ... }`