Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ClarifyingSymbol to CurrencyDisplay #111

Open
PostScripton opened this issue Nov 13, 2022 · 0 comments
Open

Add ClarifyingSymbol to CurrencyDisplay #111

PostScripton opened this issue Nov 13, 2022 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@PostScripton
Copy link
Owner

This means that currencies with, for example, $ symbol will identify their true nature.

For example, both Canadian and American dollars have the same symbol $, and in order to understand which is which, ClarifyingSymbol comes into place.

$cad = currency('CAD')->setDisplay(CurrencyDisplay::ClarifyingSymbol);
$cadMoney = money('2500', $cad);

$usd = currency('USD')->setDisplay(CurrencyDisplay::ClarifyingSymbol);
$usdMoney = money('2500', $usd);

$cadMoney->toString(); // "CA$ 0.25"
$usdMoney->toString(); // "US$ 0.25"

⚠️ This will work only for currencies with the same symbols.

@PostScripton PostScripton added the enhancement New feature or request label Nov 13, 2022
@PostScripton PostScripton added this to the v4.0 milestone Nov 13, 2022
@PostScripton PostScripton mentioned this issue Nov 26, 2022
@PostScripton PostScripton modified the milestones: v4.0, v4.1 Dec 4, 2022
@PostScripton PostScripton modified the milestones: v4.1, 4.2 Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant