Skip to content

Add ClarifyingSymbol to CurrencyDisplay #111

@PostScripton

Description

@PostScripton

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions