Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
tooltips: {
callbacks: {
label(tooltipItem, data) {
const dataset = data.datasets[tooltipItem.datasetIndex];
const label = data.labels[tooltipItem.index];
const currentValue = dataset.data[tooltipItem.index];
const percentage = parseFloat((currentValue * 100).toFixed(0));
return `${label}: ${percentage}%`;
},
},
},
},
});
export const inputmask = new Inputmask({
alias: 'currency',
allowMinus: false,
autoUnmask: true,
prefix: '',
});
export const formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
minimumFractionDigits: 2,
});