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
Format quota email currency values #7605
Format quota email currency values #7605
Conversation
Codecov Report
@@ Coverage Diff @@
## main #7605 +/- ##
=========================================
Coverage 14.40% 14.40%
- Complexity 10109 10110 +1
=========================================
Files 2748 2748
Lines 259390 259401 +11
Branches 40381 40382 +1
=========================================
+ Hits 37353 37361 +8
- Misses 217207 217209 +2
- Partials 4830 4831 +1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good functionality, small remarks
framework/quota/src/main/java/org/apache/cloudstack/quota/QuotaAlertManagerImpl.java
Outdated
Show resolved
Hide resolved
@blueorangutan package |
@DaanHoogland a [LL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Packaging result [LL]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6110 |
@blueorangutan test |
@DaanHoogland a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
[SF] Trillian test result (tid-6708)
|
@DaanHoogland could we rerun the tests for this PR? |
@blueorangutan package |
@JoaoJandre a [SF] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6722 |
@blueorangutan test |
@DaanHoogland a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
[SF] Trillian test result (tid-7359)
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CLGTM
* <li>value.toString() if the numberFormat is null;</li> | ||
* <li>the value formatted if both parameters are not null;</li> | ||
*/ | ||
public static String formatBigDecimalAccordingToNumberFormat(BigDecimal value, NumberFormat numberFormat) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could add some unit tests for this method.
@@ -238,19 +248,29 @@ public void sendQuotaAlert(DeferredQuotaEmail emailToBeSent) { | |||
} | |||
} | |||
|
|||
private NumberFormat getLocaleFormatIfCurrencyLocaleNotNull() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could add some unit tests for this method.
@blueorangutan package |
@DaanHoogland a [SF] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7281 |
@blueorangutan test |
@DaanHoogland a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
[SF] Trillian test result (tid-7894)
|
Description
Currently, in the Quota emails, the formatting of monetary values does not include the currency symbol defined in the
quota.currency.symbol
configuration. Additionally, the values are not formatted.This PR changes the Quota emails to use the quota.currency.symbol configuration to set the currency symbol. Additionally, a new configuration has also been created,
quota.currency.locale
, which should be set to format the value's punctuation in the quota emails using the wanted locale, en-US or pt-BR for example.Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
I tested different combinations to observe the changes in the received quota emails.
Test value = 12863.56
quota.currency.symbol
quota.currency.locale
null
null