-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Use toLocaleString
with usage of credits
#12236
Conversation
started the job as gitpod-build-ft-localedcredits.1 because the annotations in the pull request description changed |
@@ -114,7 +114,7 @@ function TeamUsage() { | |||
const calculateTotalUsage = () => { | |||
let totalCredits = 0; | |||
billedUsage.forEach((session) => (totalCredits += session.credits)); | |||
return totalCredits.toFixed(2); | |||
return totalCredits.toLocaleString(undefined, { maximumFractionDigits: 2 }); |
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.
I think this was meant to be fixed, but was not part of those discussions.
Deferring review to @gtsiolis 🏀
/werft run with-preview with-payment 👍 started the job as gitpod-build-ft-localedcredits.2 |
Spinning up a preview environment above[1] and will try to test this there. For visual changes like this, it would be really helpful in the future include If testing this in a preview environment is impossible for some reason, listing the visual changes clearly with text could also suffice. ✔️ |
Thanks @gtsiolis for the feedback 🙏! I 💯 agree about your points on testing and screenshots, I didn't include them since I didn't find a proper way to test these changes myself (the billing I suppose is a bit harder to set up). I see the |
@filiptronicek It's ok! I've also found out about this by accident while reviewing PRs relevant to the billing feature. We could certainly be more intentional and better at documenting such things. We already have a support matrix (internal) in Product Engineering / Preview Environments, but I don't think this clearly lists the available commands for |
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.
From what I understand by reading the PR description and after testing in the preview environment, this does not introduce any visual changes. @filiptronicek Let me know if this is not the case.
Production | Preview Environment |
---|---|
/unhold |
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.
✔️ to unblock,
hold bc would love to see this suggestion in.
Co-authored-by: Gero Posmyk-Leinemann <32448529+geropl@users.noreply.github.com>
Thanks, @filiptronicek @geropl! Removing the hold. /unhold |
Description
Make bigger amounts of used credits more easily readable by using the browsers locale to format the number. This also solved an issue where trailing zeros would appear if the number was for example exactly
.2
. This may be intentional though and if so, it is easy to fix.This change does not change how values are rounded, both this method and the previous one do it in the same way.
Related Issue(s)
None I am aware of.
How to test
TBD. Easier to test in prod 😆
Release Notes
Documentation
Werft options: