fix(demography): verify D01-D06 in isolated QA with INE traceability
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user