How could I inherit/override a function in Odoo 16 javascript example
In the addons/web/static/src/views/fields/formatters.js there is a function
export function formatFloat(value, options = {}) {
if (value === false) {
return "";
}
if (options.humanReadable) {
return humanNumber(value, options);
}
const grouping = options.grouping || l10n.grouping;
const thousandsSep = "thousandsSep" in options ? options.thousandsSep : l10n.thousandsSep;
const decimalPoint = "decimalPoint" in options ? options.decimalPoint : l10n.decimalPoint;
let precision;
if (options.digits && options.digits[1] !== undefined) {
precision = options.digits[1];
} else {
precision = 2;
}
const formatted = (value || 0).toFixed(precision).split(".");
formatted[0] = insertThousandsSep(formatted[0], thousandsSep, grouping);
if (options.noTrailingZeros) {
formatted[1] = formatted[1].replace(/0+$/, "");
}
return formatted[1] ? formatted.join(decimalPoint) : formatted[0];
}
How could I inherit/override this function?
Tried to add the same function name in my module and export it again, but it didn't work.