Skip to content
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

fix: prefix for compact numbers #1571

Merged
merged 4 commits into from
Sep 16, 2024
Merged

fix: prefix for compact numbers #1571

merged 4 commits into from
Sep 16, 2024

Conversation

gulfaraz
Copy link
Member

@gulfaraz gulfaraz commented Sep 11, 2024

Describe your changes

This PR includes follow up changes on design feedback for https://github.com/rodekruis/Anticipatory-Action/issues/644

  1. Show whole numbers for percentage values.
  2. Update functions so that,
    • 0 becomes 0
    • 2 becomes < 10
    • 12 becomes < 20
    • 20 becomes 20
    • 56 becomes 60
    • 297 becomes 300
    • 462 becomes 460
    • 1000 becomes 1K
    • 4200 becomes 4.2K
    • 225305 becomes 230K
    • 79136946 becomes 79M
    • negative numbers become 0

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have added tests wherever relevant
  • I have made sure that all automated checks pass before requesting a review

Notes for the reviewer

  1. For testing, I set value = 12 at the start of the transform function.

@gulfaraz
Copy link
Member Author

> test:api:all
> node --expose-gc node_modules/.bin/jest --config=jest.api.config.js --runInBand --detectOpenHandles --logHeapUsage

ts-jest[versions] (WARN) Version 4.9.5 of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions.
 PASS  test/email/drought/email-uga-drought.test.ts (17.266s, 214 MB heap size)
  Should send an email for uga drought
    ✓ triggered in january (7401ms)
    ✓ non triggered any month (8072ms)

 PASS  test/email/floods/email-uga-floods.test.ts (37.762s, 215 MB heap size)
  Should send an email for uga floods
    ✓ default (9045ms)
    ✓ warning (9022ms)
    ✓ warning-to-trigger (10493ms)
    ✓ no-trigger (8876ms)

 PASS  test/email/floods/email-ssd-floods.test.ts (16.398s, 225 MB heap size)
  Should send an email for ssd floods
    ✓ default (9627ms)
    ✓ no-trigger (6401ms)

 PASS  test/email/flash-flood/email-mwi-flash-flood.test.ts (32.421s, 226 MB heap size)
  Should send an email for mwi flash flood
    ✓ default (8794ms)
    ✓ no-trigger (23358ms)

 PASS  test/email/malaria/email-eth-malaria.test.ts (16.602s, 217 MB heap size)
  Should send an email for eth malaria
    ✓ default (7470ms)
    ✓ no-trigger (8864ms)

 PASS  test/email/dengue/email-phl-dengue.test.ts (16.106s, 217 MB heap size)
  Should send an email for phl dengue
    ✓ default (8223ms)
    ✓ no-trigger (7603ms)

 PASS  test/email/typhoon/email-phl-typhoon.test.ts (11.445s, 234 MB heap size)
  Should send an email for phl typhoon
    ✓ default (11189ms)

Test Suites: 7 passed, 7 total
Tests:       15 passed, 15 total
Snapshots:   0 total
Time:        148.777s
Ran all test suites.

@jannisvisser jannisvisser merged commit 674cc78 into master Sep 16, 2024
6 checks passed
@jannisvisser jannisvisser deleted the fix.compact-review branch September 16, 2024 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants