bugfixes
This commit is contained in:
@@ -267,10 +267,19 @@ export function weightColors(weights, color) {
|
||||
return adj.map((a) => a.string())
|
||||
}
|
||||
|
||||
export function allocationText(amount, weight, symbol) {
|
||||
// console.log('weight', weight, alloc, props.amount)
|
||||
const a = amount * weight
|
||||
return `${(weight * 100).toFixed(1)}% = ${a.toLocaleString('fullwide')} ${symbol}`
|
||||
export function allocationText(weight, amount, symbol) {
|
||||
let text = ''
|
||||
const hasWeight = weight!==null && weight!==undefined
|
||||
if (hasWeight)
|
||||
text += `${(weight * 100).toFixed(1)}%`
|
||||
const hasAmount = amount!==null && amount!==undefined
|
||||
const hasSymbol = symbol!==null && symbol!==undefined
|
||||
if (hasAmount && hasSymbol) {
|
||||
if (hasWeight)
|
||||
text += ' = '
|
||||
text += `${amount.toLocaleString('fullwide')} ${symbol}`
|
||||
}
|
||||
return text
|
||||
}
|
||||
|
||||
export function deleteBuilder(order, builder) {
|
||||
|
||||
Reference in New Issue
Block a user