original_string: public function formatValue($value, $idSite, Formatter $formatter)
      {
          switch ($this->type) {
              case Dimension::TYPE_BOOL:
                  if (empty($value)) {
                      return Piwik::translate('General_No');
                  }
  
                  return Piwik::translate('General_Yes');
              case Dimension::TYPE_ENUM:
                  $values = $this->getEnumColumnValues();
                  if (isset($values[$value])) {
                      return $values[$value];
                  }
                  break;
              case Dimension::TYPE_MONEY:
                  return $formatter->getPrettyMoney($value, $idSite);
              case Dimension::TYPE_FLOAT:
                  return $formatter->getPrettyNumber((float) $value, $precision = 2);
              case Dimension::TYPE_NUMBER:
                  return $formatter->getPrettyNumber($value);
              case Dimension::TYPE_DURATION_S:
                  return $formatter->getPrettyTimeFromSeconds($value, $displayAsSentence = false);
              case Dimension::TYPE_DURATION_MS:
                  return $formatter->getPrettyTimeFromSeconds($value, $displayAsSentence = true);
              case Dimension::TYPE_PERCENT:
                  return $formatter->getPrettyPercentFromQuotient($value);
              case Dimension::TYPE_BYTE:
                  return $formatter->getPrettySizeFromBytes($value);
          }
  
          return $value;
      }
code: public function formatValue($value, $idSite, Formatter $formatter)
      {
          switch ($this->type) {
              case Dimension::TYPE_BOOL:
                  if (empty($value)) {
                      return Piwik::translate('General_No');
                  }
  
                  return Piwik::translate('General_Yes');
              case Dimension::TYPE_ENUM:
                  $values = $this->getEnumColumnValues();
                  if (isset($values[$value])) {
                      return $values[$value];
                  }
                  break;
              case Dimension::TYPE_MONEY:
                  return $formatter->getPrettyMoney($value, $idSite);
              case Dimension::TYPE_FLOAT:
                  return $formatter->getPrettyNumber((float) $value, $precision = 2);
              case Dimension::TYPE_NUMBER:
                  return $formatter->getPrettyNumber($value);
              case Dimension::TYPE_DURATION_S:
                  return $formatter->getPrettyTimeFromSeconds($value, $displayAsSentence = false);
              case Dimension::TYPE_DURATION_MS:
                  return $formatter->getPrettyTimeFromSeconds($value, $displayAsSentence = true);
              case Dimension::TYPE_PERCENT:
                  return $formatter->getPrettyPercentFromQuotient($value);
              case Dimension::TYPE_BYTE:
                  return $formatter->getPrettySizeFromBytes($value);
          }
  
          return $value;
      }
code_tokens: public function formatValue ( $ value , $ idSite , Formatter $ formatter ) { switch ( $ this -> type ) { case Dimension :: TYPE_BOOL : if ( empty ( $ value ) ) { return Piwik :: translate ( 'General_No' ) ; } return Piwik :: translate ( 'General_Yes' ) ; case Dimension :: TYPE_ENUM : $ values = $ this -> getEnumColumnValues ( ) ; if ( isset ( $ values [ $ value ] ) ) { return $ values [ $ value ] ; } break ; case Dimension :: TYPE_MONEY : return $ formatter -> getPrettyMoney ( $ value , $ idSite ) ; case Dimension :: TYPE_FLOAT : return $ formatter -> getPrettyNumber ( ( float ) $ value , $ precision = 2 ) ; case Dimension :: TYPE_NUMBER : return $ formatter -> getPrettyNumber ( $ value ) ; case Dimension :: TYPE_DURATION_S : return $ formatter -> getPrettyTimeFromSeconds ( $ value , $ displayAsSentence = false ) ; case Dimension :: TYPE_DURATION_MS : return $ formatter -> getPrettyTimeFromSeconds ( $ value , $ displayAsSentence = true ) ; case Dimension :: TYPE_PERCENT : return $ formatter -> getPrettyPercentFromQuotient ( $ value ) ; case Dimension :: TYPE_BYTE : return $ formatter -> getPrettySizeFromBytes ( $ value ) ; } return $ value ; }
docstring: Formats the dimension value. By default, the dimension is formatted based on the set dimension type.
  
  @param mixed $value
  @param int $idSite
  @param Formatter $formatter
  @return mixed
  @api since Piwik 3.2.0
docstring_tokens: Formats the dimension value . By default the dimension is formatted based on the set dimension type .