1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-18 12:54:27 +01:00

Override angular currency filter, use Intl.NumberFormat to format amount

This commit is contained in:
Du Peng 2022-06-15 19:44:55 +02:00
parent f40f80dd1f
commit d45c03d36e
2 changed files with 10 additions and 0 deletions

View File

@ -10,6 +10,7 @@
- Run the docker image with the system user
- During the setup, autoconfigure the main domain
- During the setup, ask to set ALLOW_INSECURE_HTTP if DEFAULT_PROTOCOL was set to http
- Override angular currency filter, use Intl.NumberFormat to format amount
- Fix a bug: unable to set the twitter input empty
- Fix a bug: unable to edit an event
- Fix a bug: times are not shown in admin/events monitoring page

View File

@ -350,3 +350,12 @@ Application.Filters.filter('filterDisabled', [function () {
}
};
}]);
Application.Filters.filter('currency', [function ($locale) {
return function (amount) {
// if null or undefined pass it through
return (amount == null)
? amount
: new Intl.NumberFormat(Fablab.intl_locale, { style: 'currency', currency: Fablab.intl_currency }).format(amount);
};
}]);