From 8732e4b18f65e88947f3d334fc0bcc42a809c76e Mon Sep 17 00:00:00 2001 From: Haben Amare Date: Mon, 25 May 2020 22:05:06 +0000 Subject: use `Intl.NumberFormat` to format currency --- client/components/cards/minicard.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'client/components/cards/minicard.js') diff --git a/client/components/cards/minicard.js b/client/components/cards/minicard.js index e40dad5d..2eb6131c 100644 --- a/client/components/cards/minicard.js +++ b/client/components/cards/minicard.js @@ -16,7 +16,11 @@ BlazeComponent.extendComponent({ const customFieldTrueValue = customField && customField.trueValue ? customField.trueValue : ''; - return `${definition.settings.currencySymbol}${customFieldTrueValue}`; + const locale = TAPi18n.getLanguage(); + return new Intl.NumberFormat(locale, { + style: 'currency', + currency: definition.settings.currencyCode, + }).format(customFieldTrueValue); }, events() { -- cgit v1.2.3-1-g7c22