/** * Get the value of an entry as text. * * The value will be returned in a format suitable for presentation, * e.g., rationals will be returned as 'x/y', ASCII strings will be * returned as themselves etc. * * @param boolean some values can be returned in a long or more * brief form, and this parameter controls that. * * @return string the value as text. */ function getText($brief = false) { if (isset($this->value[0])) { $v = $this->value[0]; } switch ($this->tag) { case PelTag::SHUTTER_SPEED_VALUE: //CC (e->components, 1, v); //if (!v_srat.denominator) return (NULL); return Pel::fmt('%.0f/%.0f sec. (APEX: %d)', $v[0], $v[1], pow(sqrt(2), $v[0] / $v[1])); case PelTag::BRIGHTNESS_VALUE: //CC (e->components, 1, v); // // TODO: figure out the APEX thing, or remove this so that it is // handled by the default clause at the bottom. return sprintf('%d/%d', $v[0], $v[1]); //FIXME: How do I calculate the APEX value? //FIXME: How do I calculate the APEX value? case PelTag::EXPOSURE_BIAS_VALUE: //CC (e->components, 1, v); //if (!v_srat.denominator) return (NULL); return sprintf('%s%.01f', $v[0] * $v[1] > 0 ? '+' : '', $v[0] / $v[1]); default: return parent::getText($brief); } }