Closed sembrestels closed 4 years ago
It is not used always, it is there because organizations and activity are integers.
At this point we should probably consider a small component then. I'm not sure if I like the idea of having to pass undefined
in most of the cases, and in general I think fixedDecimals
should probably have been a number
parameter, not a boolean. What do you think?
If we want to stick with just one function (formatNumber
), we can just change the order of the parameters (formatNumber(num, decimals = 0, cutoff = 10000)
), so we avoid to pass the undefined
value.
Another option is to define two functions: formatInteger(num, cutoff = 10000)
and formatFloat(num, cutoff = 10000, decimals = 2)
.
Which do you prefer?
I think changing the order of the parameters like you first proposed would make most sense to be honest. Good thinking
@lkngtn You can deploy this whenever
Can we just remove
fixedDecimals
and always have that behavior?