当前位置: 首页>>代码示例>>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;未经允许,请勿转载。