ordershape fixes
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {routeInverted, timestamp, uuid} from "@/misc.js";
|
||||
import {timestamp, uuid} from "@/misc.js";
|
||||
import {MAX_FRACTION, newTranche} from "@/blockchain/orderlib.js";
|
||||
import {useOrderStore, useStore} from "@/store/store.js";
|
||||
import {encodeIEE754} from "@/common.js";
|
||||
@@ -251,25 +251,6 @@ export function weightColors(weights, color) {
|
||||
return adj.map((a) => a.string())
|
||||
}
|
||||
|
||||
export function allocationText(weight, amount, symbol) {
|
||||
const hasAmount = amount!==null && amount!==undefined && amount > 0
|
||||
if (hasAmount)
|
||||
amount = Number(amount)
|
||||
const hasWeight = weight!==null && weight!==undefined
|
||||
if (hasWeight)
|
||||
weight = Number(weight)
|
||||
let text = ''
|
||||
if (hasWeight)
|
||||
text += `${(weight * 100).toFixed(1)}%`
|
||||
const hasSymbol = symbol!==null && symbol!==undefined
|
||||
if (hasAmount && hasSymbol) {
|
||||
if (hasWeight)
|
||||
text += ' = '
|
||||
text += `${amount.toPrecision(3).toLocaleString('fullwide')} ${symbol}`
|
||||
}
|
||||
return text
|
||||
}
|
||||
|
||||
export function deleteBuilder(order, builder) {
|
||||
order.builders = order.builders.filter((b) => b !== builder)
|
||||
}
|
||||
Reference in New Issue
Block a user