Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const BuyOrder = (props: SingleOrderProps) => {
const { order, onClick } = props;
return (
{formatNumber(order.total, { precision: 3 })}
{formatNumber(order.amount, { precision: 3 })}
{formatNumber(order.price, { precision: 5 })}
);
};
const BuyOrder = (props: SingleOrderProps) => {
const { order, onClick } = props;
return (
{formatNumber(order.total, { precision: 3 })}
{formatNumber(order.amount, { precision: 3 })}
{formatNumber(order.price, { precision: 5 })}
);
};
const BuyOrder = (props: SingleOrderProps) => {
const { order, onClick } = props;
return (
{formatNumber(order.total, { precision: 3 })}
{formatNumber(order.amount, { precision: 3 })}
{formatNumber(order.price, { precision: 5 })}
);
};
const BuyOrder = (props: SingleOrderProps) => {
const { order, onClick } = props;
return (
{formatNumber(order.total, { precision: 3 })}
{formatNumber(order.amount, { precision: 3 })}
{formatNumber(order.price, { precision: 5 })}
);
};
const ReceiptLineComponent = props => (
);
writePromises.push(
BluetoothSerial.write(
TinyPOS.bufferedText(
`${finalLines}`,
{ align: "left", size: "normal" },
true,
),
),
);
totalQty = totalQty + val.qty;
totalAmount =
totalAmount + parseFloat(val.price, 10) * parseFloat(val.qty, 10);
});
let total = strings.Total;
let totalQtyString = totalQty.toString();
let totalAmountString = formatNumber(totalAmount).toString();
for (let t = 0; t < 13 - totalQtyString.length; t += 1) {
total = total + " ";
}
total = total + totalQtyString;
for (let tt = 0; tt < 33 - total.length; tt += 1) {
total = total + " ";
}
total = total + totalAmountString;
writePromises.push(
BluetoothSerial.write(
TinyPOS.bufferedText(
"===============================",
{ size: "normal" },
true,
);
}
} else {
writePromises.push(
BluetoothSerial.write(
TinyPOS.bufferedText(
`${name}`,
{ align: "left", size: "normal" },
true,
),
),
);
}
let priceString = formatNumber(parseFloat(val.price, 10)).toString();
let qtyString = val.qty.toString();
let amountString = formatNumber(
parseFloat(val.price, 10) * parseFloat(val.qty, 10),
).toString();
for (let ps = 0; ps < 12 - priceString.length; ps += 1) {
finalLines = finalLines + " ";
}
finalLines = finalLines + priceString;
for (let qt = 0; qt < 6 - qtyString.length; qt += 1) {
finalLines = finalLines + " ";
}
finalLines = finalLines + qtyString;
for (let as = 0; as < 14 - amountString.length; as += 1) {
finalLines = finalLines + " ";
writePromises.push(
BluetoothSerial.write(
TinyPOS.bufferedText(
`${name}`,
{ align: "left", size: "normal" },
true,
),
),
);
}
let priceString = formatNumber(
parseFloat(val.price, 10),
).toString();
let qtyString = val.qty.toString();
let amountString = formatNumber(
parseFloat(val.price, 10) * parseFloat(val.qty, 10),
).toString();
for (let ps = 0; ps < 12 - priceString.length; ps += 1) {
finalLines = finalLines + " ";
}
finalLines = finalLines + priceString;
for (let qt = 0; qt < 6 - qtyString.length; qt += 1) {
finalLines = finalLines + " ";
}
finalLines = finalLines + qtyString;
for (let as = 0; as < 14 - amountString.length; as += 1) {
finalLines = finalLines + " ";
),
),
);
}
} else {
writePromises.push(
BluetoothSerial.write(
TinyPOS.bufferedText(
`${name}`,
{ align: "left", size: "normal" },
true,
),
),
);
}
let priceString = formatNumber(parseFloat(val.price, 10)).toString();
let qtyString = val.qty.toString();
let amountString = formatNumber(
parseFloat(val.price, 10) * parseFloat(val.qty, 10),
).toString();
for (let ps = 0; ps < 12 - priceString.length; ps += 1) {
finalLines = finalLines + " ";
}
finalLines = finalLines + priceString;
for (let qt = 0; qt < 6 - qtyString.length; qt += 1) {
finalLines = finalLines + " ";
}
finalLines = finalLines + qtyString;
JSON.parse(report.categories_total_amounts).map(val => {
let categoryString = "" + val.name;
let valueString = formatNumber(
parseFloat(val.total_amount, 10),
).toString();
let totalLength = categoryString.length + valueString.length;
for (let i = 0; i < 32 - totalLength; i += 1) {
categoryString += " ";
}
categoryString += valueString;
writePromises.push(
BluetoothSerial.write(
TinyPOS.bufferedText(
`${categoryString}`,
{ size: "normal" },
true,
),
),