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

Hotfix/give currency symbol #1691

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions includes/misc-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,73 +121,73 @@ function give_currency_symbol( $currency = '' ) {
}
switch ( $currency ) :
case 'GBP' :
$symbol = '£';
$symbol = '£';
break;
case 'BRL' :
$symbol = 'R$';
$symbol = 'R$';
break;
case 'EUR' :
$symbol = '';
$symbol = '€';
break;
case 'NOK' :
$symbol = 'Kr.';
$symbol = 'kr.';
break;
case 'INR' :
$symbol = '';
$symbol = '₹';
break;
case 'USD' :
case 'AUD' :
case 'CAD' :
case 'HKD' :
case 'MXN' :
case 'SGD' :
$symbol = '$';
$symbol = '$';
break;
case 'JPY' :
$symbol = '¥';
$symbol = '¥';
break;
case 'THB' :
$symbol = '฿';
$symbol = '฿';
break;
case 'TRY' :
$symbol = '';
$symbol = '₺';
break;
case 'TWD' :
$symbol = 'NT$';
$symbol = 'NT$';
break;
case 'ILS' :
$symbol = '';
$symbol = '₪';
break;
case 'RIAL' :
$symbol = '';
$symbol = '﷼';
break;
case 'RUB' :
$symbol = 'руб';
$symbol = '₽';
break;
case 'DKK' :
case 'SEK' :
$symbol = ' kr. ';
break;
case 'PLN' :
$symbol = '';
$symbol = 'zł';
break;
case 'PHP' :
$symbol = '';
$symbol = '₱';
break;
case 'MYR' :
$symbol = 'RM';
$symbol = 'RM';
break;
case 'HUF' :
$symbol = 'Ft';
$symbol = 'Ft';
break;
case 'CZK' :
$symbol = '';
$symbol = 'Kč';
break;
case 'KRW' :
$symbol = '';
$symbol = '₩';
break;
case 'ZAR' :
$symbol = 'R';
$symbol = 'R';
break;
case 'MAD' :
$symbol = '.د.م';
Expand Down
12 changes: 6 additions & 6 deletions tests/unit-tests/tests-formatting.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,12 @@ public function test_give_currency_filter( $price, $currency, $currency_position
*/
public function give_currency_filter_provider() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DevinWalker check this updated test also.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

return array(
array( '10', 'USD', 'after', '10$' ),
array( '10', 'ZAR', 'after', '10R' ),
array( '10', 'NOK', 'after', '10 Kr.' ),
array( '10', 'USD', 'before', '$10' ),
array( '10', 'ZAR', 'before', 'R10' ),
array( '10', 'NOK', 'before', 'Kr. 10' ),
array( '10', 'USD', 'after', '10$' ),
array( '10', 'ZAR', 'after', '10R' ),
array( '10', 'NOK', 'after', '10 kr.' ),
array( '10', 'USD', 'before', '$10' ),
array( '10', 'ZAR', 'before', 'R10' ),
array( '10', 'NOK', 'before', 'kr. 10' ),
);
}

Expand Down