예제 #1
0
파일: Money.php 프로젝트: novuso/common
 /**
  * Retrieves a formatted string representation
  *
  * @param string $locale The locale
  *
  * @return string
  */
 public function format(string $locale = 'en_US') : string
 {
     return LocaleFormatter::fromLocale($locale)->format($this);
 }
예제 #2
0
 public function test_that_format_returns_expected_output_for_locale()
 {
     $formatter = LocaleFormatter::fromLocale('en_US');
     $this->assertSame('$1,100.75', $formatter->format(Money::USD(110075)));
 }