本文整理汇总了PHP中Money\Money::Euro方法的典型用法代码示例。如果您正苦于以下问题:PHP Money::Euro方法的具体用法?PHP Money::Euro怎么用?PHP Money::Euro使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Money\Money
的用法示例。
在下文中一共展示了Money::Euro方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ConvertsEurToUsdWithModes
/** @test */
public function ConvertsEurToUsdWithModes()
{
$eur = Money::Euro(10);
$pair = new CurrencyPair(CurrencyProxy::determine('EUR'), CurrencyProxy::determine('USD'), 1.25);
$usd = $pair->convert($eur);
$this->assertEquals(Money::USD(13), $usd);
$pair = new CurrencyPair(CurrencyProxy::determine('EUR'), CurrencyProxy::determine('USD'), 1.25);
$usd = $pair->convert($eur, new RoundingMode(RoundingMode::ROUND_HALF_DOWN));
$this->assertEquals(Money::USD(12), $usd);
}
示例2: setUp
public function setUp()
{
$this->money_usd = Money::USD(1234);
$this->money_euro = Money::Euro(1234);
$this->money_czech = Money::Koruna(1234);
}
示例3: testComparators
public function testComparators()
{
$this->assertTrue(Money::Euro(0)->isZero());
$this->assertTrue(Money::Euro(-1)->isNegative());
$this->assertTrue(Money::Euro(1)->isPositive());
$this->assertFalse(Money::Euro(1)->isZero());
$this->assertFalse(Money::Euro(1)->isNegative());
$this->assertFalse(Money::Euro(-1)->isPositive());
}