vue/components/Vendors/VendorOrderingInformation.vue + formatTaxRate(taxRate) { + if (!taxRate) return 0; + const decimalPlaces = taxRate.toString().split(".")[1]?.length || 0; + const multiplier = 10 ** decimalPlaces; + return Math.round(taxRate * multiplier) / (multiplier / 100); + }, + formatDiscount() { + if (!this.vendor.discount) return 0.0; + const decimalPlaces = + this.vendor.discount.toString().split(".")[1]?.length || 0; + if (decimalPlaces) { + return this.vendor.discount; + } else { + return this.vendor.discount.toFixed(1); + } + }, This should not be there. Ideally it should be in a js file that would be reusable from outside vue.