Skip to content

Conversation

@JerryVincent
Copy link
Collaborator

Type of Change

  • Dependency upgrade
  • Bug fix (non-breaking change)
  • Breaking change
    • e.g. a fixed bug or new feature that may break something else
  • New feature
  • Code quality improvements
    • e.g. refactoring, documentation, tests, tooling, ...

Implementation

Changed the ordinary representation of the device count in the user profile to short scale notation since the other parameters like sensor count and measurement counts are using the short scale notations.

Checklist

  • I gave this pull request a meaningful title
  • My pull request is targeting the dev branch
  • I have added documentation to my code
  • I have deleted code that I have commented out

Additional Information

Comment on lines +86 to +94
function formatCount(num: number): string {
if (num >= 1_000_000) {
return `${(num / 1_000_000).toFixed(1).replace(/\.0$/, '')}M`
}
if (num >= 1_000) {
return `${(num / 1_000).toFixed(1).replace(/\.0$/, '')}k`
}
return num.toString()
}
Copy link
Member

Choose a reason for hiding this comment

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

I think we shouldn't duplicate the code. This already exists in profile.server.ts.
I suggest you move that to utils/misc.ts and use it in both places.

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.

Use Short Scale notation to represent Device count in the profile

3 participants