saleor-dashboard/cypress/support/format/formatCurrencyAmount.js
Karolina Rakoczy e7a06281f1
fix failing tests (#1302)
* fix failing tests

* no retries

* add waiting for confirmation msg

* remove unused import

* fix test for staff

* fix test for staff

* fix tests for orders

* fix tests for channels

* fix autocomplete

* fix filters

* fix filters

* fix create shipping method
2021-09-10 10:59:46 +02:00

12 lines
400 B
JavaScript

export function getFormattedCurrencyAmount(amount, currency) {
const language = window.navigator.userLanguage || window.navigator.language;
const formattedCurrencyAmount = amount.toLocaleString(language, {
currency,
style: "currency"
});
return formattedCurrencyAmount;
}
export function getCurrencyAndAmountInString(amount, currency) {
return `${currency}${amount.toFixed(2)}`;
}