To display the total amount after rounding into a fixed decimal place in Advanced PDF template, refer sample code below
Tag: rounding
Round a float number
/** * @description To round a float number * @param {Number|String} value * @param {Number|String} decimals * @returns {Number} Floating Point Number with the given precision */ const roundFloat = (value, decimals) => { decimals = (decimals) ? decimals : 2; return Number(Math.round(parseFloat(value) + ‘e’ + parseInt(decimals)) + ‘e-‘ + parseInt(decimals)); };