Luckily we have @Mabaega as an Indonesian and a programmer that always up to date to the Manager system and tax system. You do a great job bro @Mabaega
@Mabaega maybe consider changing that part of the code to:
// Format angka sesuai locale
const numberFormatter = new Intl.NumberFormat(isIdLocale ? "id-ID" : "en-US", {
minimumFractionDigits: isIdLocale ? 0 : 2,
maximumFractionDigits: isIdLocale ? 0 : 2
});
Thus for Indonesia (id-ID), we set both minimumFractionDigits and maximumFractionDigits to 0, thus no decimal places will be shown, and for the US (en-US), we keep minimumFractionDigits and maximumFractionDigits set to 2, ensuring that 2 decimal places are always shown.
I don’t understand why you choose to use numbers without decimals on your invoices. As far as I know, in the CoreTax system all numbers use two Decimal Places.
For your needs, you can change this section, replacing 2 with 0.
// Format angka sesuai locale
const numberFormatter = new Intl.NumberFormat(isIdLocale ? "id-ID" : "en-US", {
minimumFractionDigits: 2,
maximumFractionDigits: 2
});
to
// Format angka sesuai locale
const numberFormatter = new Intl.NumberFormat(isIdLocale ? "id-ID" : "en-US", {
minimumFractionDigits: 0,
maximumFractionDigits: 0
});
id-ID stand for Indonesian language and country code, respectively. en-US for English and United States. These codes are used in internationalization (i18n) functions like Intl.NumberFormat() to apply locale-specific formatting rules, such as number formatting, currency symbols, and date/time formats.