You are here

public function AbstractUnitsMathematicalOperator::toPostfix in Units of Measurement 7.2

Represent this mathematical expression in postfix notation.

Represent this mathematical expression in postfix (reverse polish) notation.

Parameters

array $options: Options regarding how to format this mathematical expression

Return value

string Postfix (reverse polish) notation representation of this mathematical expression

Overrides UnitsMathematicalExpression::toPostfix

File

./units.module, line 1436
Provide API for managing and converting units of measurement.

Class

AbstractUnitsMathematicalOperator
Abstract implementation of "mathematical operator" interface.

Code

public function toPostfix($options = array()) {
  return implode(' ', array(
    $this->operand1
      ->toPostfix(),
    $this->operand2
      ->toPostfix(),
    $this->operator['sign'],
  ));
}