-
Notifications
You must be signed in to change notification settings - Fork 117
Closed
Labels
featurea feature request or enhancementa feature request or enhancementwipwork in progresswork in progress
Description
I was writing this hack recently
t_dollar <- dollar_format(suffix = 'T')
b_dollar <- dollar_format(suffix = 'b')
m_dollar <- dollar_format(suffix = 'm')
k_dollar <- dollar_format(suffix = 'k')
nice_dollar <- function(x) {
sapply(x, FUN=function(amount) {
if (is.na(amount)) return('n.a.')
if (amount > 9e11) return(t_dollar(amount/1e12))
if (amount > 9e8) return(b_dollar(amount/1e9))
if (amount > 9e5) return(m_dollar(amount/1e6))
if (amount > 9e2) return(k_dollar(amount/1e3))
dollar(amount)
})
}which is useful in scenarios with free scales
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featurea feature request or enhancementa feature request or enhancementwipwork in progresswork in progress
