How to use accounting-js - 10 common examples

To help you get started, we’ve selected a few accounting-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ProofSuite / amp-client / src / components / OrderBook / VerticalOrderBook.js View on Github external
const BuyOrder = (props: SingleOrderProps) => {
  const { order, onClick } = props;

  return (
    
      
      {formatNumber(order.total, { precision: 3 })}
      {formatNumber(order.amount, { precision: 3 })}
      {formatNumber(order.price, { precision: 5 })}
    
  );
};
github ProofSuite / amp-client / src / components / OrderBook / HorizontalOrderBook.js View on Github external
const BuyOrder = (props: SingleOrderProps) => {
  const { order, onClick } = props;

  return (
    
      
      {formatNumber(order.total, { precision: 3 })}
      {formatNumber(order.amount, { precision: 3 })}
      {formatNumber(order.price, { precision: 5 })}
    
  );
};
github ProofSuite / amp-client / src / components / OrderBook / VerticalOrderBook.js View on Github external
const BuyOrder = (props: SingleOrderProps) => {
  const { order, onClick } = props;

  return (
    
      
      {formatNumber(order.total, { precision: 3 })}
      {formatNumber(order.amount, { precision: 3 })}
      {formatNumber(order.price, { precision: 5 })}
    
  );
};
github ProofSuite / amp-client / src / components / OrderBook / HorizontalOrderBook.js View on Github external
const BuyOrder = (props: SingleOrderProps) => {
  const { order, onClick } = props;

  return (
    
      
      {formatNumber(order.total, { precision: 3 })}
      {formatNumber(order.amount, { precision: 3 })}
      {formatNumber(order.price, { precision: 5 })}
    
  );
};
github bailabs / tailpos / src / stories / components / PrintItemSalesReportComponent.js View on Github external
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,
github bailabs / tailpos / src / stories / components / PrintItemSalesReportComponent.js View on Github external
);
      }
    } 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 + " ";
github bailabs / tailpos / src / container / PaymentContainer / on_pay.js View on Github external
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 + " ";
github bailabs / tailpos / src / stories / components / PrintItemSalesReportComponent.js View on Github external
),
          ),
        );
      }
    } 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;
github bailabs / tailpos / src / container / ShiftInfoContainer / index.js View on Github external
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,
                ),
              ),

accounting-js

Number, money and currency formatting library.

MIT
Latest version published 9 years ago

Package Health Score

50 / 100
Full package analysis

Popular accounting-js functions