improve short format for balance credits >1K and >1M #184
Labels
No labels
area: devops
area: discovery
area: docs
area: livestream
area: proposal
consider soon
dependencies
Epic
good first issue
hacktoberfest
help wanted
icebox
Invalid
level: 1
level: 2
level: 3
level: 4
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
on hold
priority: blocker
priority: high
priority: low
priority: medium
resilience
Tom's Wishlist
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbry-redux#184
Loading…
Reference in a new issue
No description provided.
Delete branch "format-big-credits"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -6,0 +1,4 @@
export function formatCredits(amount, precision, shortFormat = false) {
let actualAmount = parseFloat(amount),
suffix = '';
if (Number.isNaN(actualAmount)) return '0';
Would it make more sense for this functionality to be a parameter to formatCredits rather than a standalone function?
@ -6,0 +1,4 @@
export function formatCredits(amount, precision, shortFormat = false) {
let actualAmount = parseFloat(amount),
suffix = '';
if (Number.isNaN(actualAmount)) return '0';
I was trying to avoid having to update all the references to the method, as there are quite a few.
@ -6,0 +1,4 @@
export function formatCredits(amount, precision, shortFormat = false) {
let actualAmount = parseFloat(amount),
suffix = '';
if (Number.isNaN(actualAmount)) return '0';
Why would you have to update the references if you add an optional 3rd parameter?
@ -6,0 +1,4 @@
export function formatCredits(amount, precision, shortFormat = false) {
let actualAmount = parseFloat(amount),
suffix = '';
if (Number.isNaN(actualAmount)) return '0';
I suppose I wouldn't have to, now that I think about it. I should be able to roll the functionality into the
formatCredits
method.lgtm