fix(demography): verify D01-D06 in isolated QA with INE traceability

This commit is contained in:
2026-11-20 20:07:16 +02:00
parent 558c11ef17
commit 3f66201cbe
17 changed files with 570 additions and 89 deletions
+9 -3
View File
@@ -39,9 +39,15 @@ function one(rows: Row[], age: string, residence = 'all'): Row | undefined {
export const populationLabel = (n: number | null) =>
n === null
? 'Sem dados'
: new Intl.NumberFormat('pt-MZ', { maximumFractionDigits: 0 }).format(
n,
);
: new Intl.NumberFormat('pt-MZ', {
maximumFractionDigits: 0,
useGrouping: 'always',
}).format(n);
// Formatting only: never write rounded values back to evidence or calculations.
export const populationValueLabel = (value: string) =>
/^-?\d+(\.\d+)?$/.test(value) && Number.isFinite(Number(value))
? populationLabel(Number(value))
: 'Sem dados';
export const percentageLabel = (n: number | null) =>
n === null
? 'Sem dados'