allocation text fix; props&points suppressed during drag

This commit is contained in:
Tim
2024-05-06 15:24:47 -04:00
parent 613cb7d7f5
commit c3c5db9c23
5 changed files with 38 additions and 26 deletions

View File

@@ -240,6 +240,8 @@ export function weightColors(weights, color) {
}
export function allocationText(weight, amount, symbol) {
amount = Number(amount)
weight = Number(weight)
let text = ''
const hasWeight = weight!==null && weight!==undefined
if (hasWeight)
@@ -249,7 +251,7 @@ export function allocationText(weight, amount, symbol) {
if (hasAmount && hasSymbol) {
if (hasWeight)
text += ' = '
text += `${amount.toLocaleString('fullwide')} ${symbol}`
text += `${amount.toPrecision(3).toLocaleString('fullwide')} ${symbol}`
}
return text
}