You are here

public function Price::__toString in Price 8

Same name and namespace in other branches
  1. 3.x src/Price.php \Drupal\price\Price::__toString()
  2. 2.0.x src/Price.php \Drupal\price\Price::__toString()
  3. 2.x src/Price.php \Drupal\price\Price::__toString()
  4. 3.0.x src/Price.php \Drupal\price\Price::__toString()

Gets the string representation of the price.

Return value

string The string representation of the price.

File

src/Price.php, line 70

Class

Price
Provides a value object for monetary values.

Namespace

Drupal\price

Code

public function __toString() {
  return Calculator::trim($this->number) . ' ' . $this->currencyCode;
}