Skip to content

Commit 25a89de

Browse files
authored
fix: do not default to narrowSymbol for currencyDisplay (#42)
1 parent af5d303 commit 25a89de

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## 0.5.1 - 2022-02-01
9+
10+
### Added
11+
12+
- Nothing.
13+
14+
### Changed
15+
16+
- Nothing.
17+
18+
### Deprecated
19+
20+
- Nothing.
21+
22+
### Removed
23+
24+
- Nothing.
25+
26+
### Fixed
27+
28+
- Do not default to `narrowSymbol` for `currencyDisplay`.
29+
830
## 0.5.0 - 2022-02-01
931

1032
### Added

src/FormatPHP.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ public function formatCurrency($value, string $currencyCode, ?NumberFormatOption
152152
$options = $options ?? new NumberFormatOptions();
153153
$options->style = NumberFormatOptions::STYLE_CURRENCY;
154154
$options->currency = $currencyCode;
155-
$options->currencyDisplay = $options->currencyDisplay ?? NumberFormatOptions::CURRENCY_DISPLAY_NARROW_SYMBOL;
156155

157156
return $this->formatNumber($value, $options);
158157
}

tests/FormatPHPTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,17 +373,17 @@ public function testFormatNumberWithOptions(): void
373373

374374
public function testFormatCurrency(): void
375375
{
376-
$locale = new Locale('en');
376+
$locale = new Locale('en-GB');
377377
$config = new Config($locale);
378378
$messageCollection = new MessageCollection();
379379
$formatphp = new FormatPHP($config, $messageCollection);
380380

381-
$this->assertSame('$1,234.00', $formatphp->formatCurrency(1234, 'USD'));
381+
$this->assertSame('US$1,234.00', $formatphp->formatCurrency(1234, 'USD'));
382382
}
383383

384384
public function testFormatCurrencyWithOptions(): void
385385
{
386-
$locale = new Locale('en');
386+
$locale = new Locale('en-US');
387387
$config = new Config($locale);
388388
$messageCollection = new MessageCollection();
389389
$formatphp = new FormatPHP($config, $messageCollection);

0 commit comments

Comments
 (0)