original_string: public function getValue( $field, $default = null ) {
          if ( array_key_exists($field, $this->defaults) ){
              switch ($this->defaults[$field]['type']) {
                  case self::TYPE_INT:
                      return (int) $this->values[$field];
                  case self::TYPE_FLOAT:
                      // Round float values to three decimal places and trim trailing zeros.
                      // Add a leading zero to values less than 1.
                      $f = sprintf('%05.3f', $this->values[$field]);
                      $f = rtrim($f, '0');
                      $f = rtrim($f, '.');
                      return (float) (empty($f) ? '0' : $f);
              }
              return $this->values[$field];
          }
  
          return $default;
      }
code: public function getValue( $field, $default = null ) {
          if ( array_key_exists($field, $this->defaults) ){
              switch ($this->defaults[$field]['type']) {
                  case self::TYPE_INT:
                      return (int) $this->values[$field];
                  case self::TYPE_FLOAT:
                      // Round float values to three decimal places and trim trailing zeros.
                      // Add a leading zero to values less than 1.
                      $f = sprintf('%05.3f', $this->values[$field]);
                      $f = rtrim($f, '0');
                      $f = rtrim($f, '.');
                      return (float) (empty($f) ? '0' : $f);
              }
              return $this->values[$field];
          }
  
          return $default;
      }
code_tokens: public function getValue ( $ field , $ default = null ) { if ( array_key_exists ( $ field , $ this -> defaults ) ) { switch ( $ this -> defaults [ $ field ] [ 'type' ] ) { case self :: TYPE_INT : return ( int ) $ this -> values [ $ field ] ; case self :: TYPE_FLOAT : // Round float values to three decimal places and trim trailing zeros. // Add a leading zero to values less than 1. $ f = sprintf ( '%05.3f' , $ this -> values [ $ field ] ) ; $ f = rtrim ( $ f , '0' ) ; $ f = rtrim ( $ f , '.' ) ; return ( float ) ( empty ( $ f ) ? '0' : $ f ) ; } return $ this -> values [ $ field ] ; } return $ default ; }
docstring: Get Label Format field from associative array.
  
  @param string        $field Name of a label format field.
  @param null|string   $default
  @return float|int|mixed|null
docstring_tokens: Get Label Format field from associative array .