當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Currency::toString方法代碼示例

本文整理匯總了PHP中Zend_Currency::toString方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Currency::toString方法的具體用法?PHP Zend_Currency::toString怎麽用?PHP Zend_Currency::toString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Currency的用法示例。


在下文中一共展示了Zend_Currency::toString方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: currency

 /**
  * Format a numeric currency value and return it as a string
  *
  * @param int|float $value   any value that return true with is_numeric
  * @param array     $options additional options to pass to the currency
  *                           constructor
  * @param string    $locale  locale value
  *
  * @throws InvalidParameterException if the $value parameter is not numeric
  * @return string the formatted value
  */
 public function currency($value, $options = array(), $locale = null)
 {
     if (!is_numeric($value)) {
         throw new InvalidArgumentException('Numeric argument expected ' . gettype($value) . ' given');
     }
     $options = array_merge($options, array('value' => $value));
     $currency = new Zend_Currency($options, $locale);
     return $currency->toString();
 }
開發者ID:JellyBellyDev,項目名稱:zle,代碼行數:20,代碼來源:Currency.php

示例2: testConstructorAllowsOverridingCurrencyDisplayFormat

 /**
  * @group ZF-11798
  * @dataProvider providerConstructorAllowsOverridingCurrencyDisplayFormat
  */
 public function testConstructorAllowsOverridingCurrencyDisplayFormat($display, $expected)
 {
     $currency = new Zend_Currency(array('value' => 100, 'display' => $display), 'en_US');
     $this->assertEquals($expected, $currency->toString());
 }
開發者ID:ThorstenSuckow,項目名稱:conjoon,代碼行數:9,代碼來源:CurrencyTest.php

示例3: testCurrencyWithSelfPattern

 /**
  * @ZF-9491
  */
 public function testCurrencyWithSelfPattern()
 {
     $currency = new Zend_Currency(array('value' => 10000, 'format' => '#,#0', 'locale' => 'de_DE'));
     $this->assertEquals('1.00.00', $currency->toString());
 }
開發者ID:travisj,項目名稱:zf,代碼行數:8,代碼來源:CurrencyTest.php

示例4: testToString

 /**
  * testing toString
  *
  */
 public function testToString()
 {
     $USD = new Zend_Currency('USD', 'en_US');
     $this->assertSame($USD->toString(), 'US Dollar');
 }
開發者ID:jorgenils,項目名稱:zend-framework,代碼行數:9,代碼來源:CurrencyTest.php

示例5: testContructingPrecisionValues

 /**
  * IsLess values
  */
 public function testContructingPrecisionValues()
 {
     $currency = new Zend_Currency(array('value' => 100.5));
     $this->assertEquals('€ 100,50', $currency->toString('de_AT'));
 }
開發者ID:vicfryzel,項目名稱:zf,代碼行數:8,代碼來源:CurrencyTest.php

示例6: getZendPrice

 /**
  * Get zend price
  */
 public function getZendPrice()
 {
     $zc = new Zend_Currency(array('value' => $this->_get('price')), strtoupper(Model_Lang::getCurrent()));
     return $zc->toString();
 }
開發者ID:jaspermeijaard,項目名稱:home-booking-system,代碼行數:8,代碼來源:Home.php


注:本文中的Zend_Currency::toString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。