-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert flows to target currency (#11)
* Convert flows to target currency * show error message if currency conversion fails * fix tests
- Loading branch information
1 parent
e9f0ba9
commit 405b96c
Showing
10 changed files
with
3,533 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
export function getCurrencyFormatter(currency: string) { | ||
const currencyFormat = new Intl.NumberFormat(undefined, { | ||
style: "currency", | ||
currency, | ||
}); | ||
return (value: any) => { | ||
return currencyFormat.format(value); | ||
}; | ||
export function getCurrencyFormatter(currency: string): (value: any) => string { | ||
try { | ||
return new Intl.NumberFormat(undefined, { style: "currency", currency }).format; | ||
} catch { | ||
return new Intl.NumberFormat().format; | ||
} | ||
} |
Binary file added
BIN
+230 KB
frontend/tests/e2e/__image_snapshots__/report_corp_converted_to_eur.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.