Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ryantxu
Copy link
Contributor

@ryantxu ryantxu commented Mar 22, 2023

What is this feature?

We currently format negative monies as $-100 and it should be -$100

Why do we need this feature?

to be more normal

image

Who is this feature for?

[Add information on what kind of user the feature is for.]

Which issue(s) does this PR fix?:

Fixes #65123

Special notes for your reviewer:

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.
  • There are no known compatibility issues with older supported versions of Grafana, or plugins.
  • It passes the Hosted Grafana feature readiness review for observability, scalability, performance, and security.

@ryantxu ryantxu added this to the 9.5.0 milestone Mar 22, 2023
@ryantxu ryantxu requested a review from baldm0mma March 22, 2023 07:24
@ryantxu ryantxu requested review from a team as code owners March 22, 2023 07:24
@ryantxu ryantxu requested review from JoaoSilvaGrafana, mckn and tskarhed and removed request for a team March 22, 2023 07:24
@github-advanced-security
Copy link
Contributor

You have successfully added a new CodeQL configuration .github/workflows/pr-codeql-analysis-javascript.yml:analyze. As part of the setup process, we have scanned this repository and found 29 existing alerts. Please check the repository Security tab to see all alerts.

Copy link
Contributor

@leventebalogh leventebalogh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 👏

Copy link
Contributor

@baldm0mma baldm0mma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fast and elegant solution! Played around with it, and works great. LGTM!

const scaler = scaledUnits(1000, units);
return (size: number, decimals?: DecimalCount, scaledDecimals?: DecimalCount) => {
if (size === null) {
return (value: number, decimals?: DecimalCount, scaledDecimals?: DecimalCount) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good change here, value makes way more sense.

@ryantxu ryantxu merged commit 01a5d50 into main Mar 22, 2023
@ryantxu ryantxu deleted the negative-currency branch March 22, 2023 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stat Panel: Single value formatting for prefix/suffix inconsistent with "accepted/common/traditional" ways of formatting values, specifically currency

4 participants