diff --git a/src/App.vue b/src/App.vue index 71f7175..7c34d14 100644 --- a/src/App.vue +++ b/src/App.vue @@ -324,6 +324,9 @@ header { margin-top: 16px; margin-bottom: 2px; text-align: center; + + white-space: pre-wrap; /* preserves newlines */ + word-break: break-word; /* wraps long lines if needed */ } .sub-header { diff --git a/src/components/risultati/A_CIL.vue b/src/components/risultati/A_CIL.vue index 8a6f2d1..08bc5c2 100644 --- a/src/components/risultati/A_CIL.vue +++ b/src/components/risultati/A_CIL.vue @@ -85,14 +85,14 @@ return new Date(dateStr).toLocaleDateString('it-IT') } - function formatNumber(val, decimals) { - return val != null - ? Number(val).toLocaleString('it-IT', { - minimumFractionDigits: decimals, - maximumFractionDigits: decimals - }) - : '—' - } +function formatNumber(val, decimals = 2, useGrouping = false) { + if (val == null) return '—' + return Number(val).toLocaleString('it-IT', { + minimumFractionDigits: decimals, + maximumFractionDigits: decimals, + useGrouping + }) +} diff --git a/src/components/risultati/A_CUB.vue b/src/components/risultati/A_CUB.vue index 7da38aa..f6ddf79 100644 --- a/src/components/risultati/A_CUB.vue +++ b/src/components/risultati/A_CUB.vue @@ -39,7 +39,7 @@ Dimensioni Massa
volumica F - Rc + Rc* RPRELIEVO R** P*** @@ -67,7 +67,7 @@ {{ formatNumber(row.dimB, 2) }} {{ formatNumber(row.dimH, 2) }} {{ formatNumber(row.massaVolumica, 0) }} - {{ formatNumber(row.f, 2) }} + {{ formatNumber(row.f, 1) }} {{ formatNumber(row.rc, 2) }} {{ row.rprelievo }} {{ row.rType }} @@ -88,14 +88,15 @@ return new Date(dateStr).toLocaleDateString('it-IT') } - function formatNumber(val, decimals) { - return val != null - ? Number(val).toLocaleString('it-IT', { - minimumFractionDigits: decimals, - maximumFractionDigits: decimals - }) - : '—' - } +function formatNumber(val, decimals = 2, useGrouping = false) { + if (val == null) return '—' + return Number(val).toLocaleString('it-IT', { + minimumFractionDigits: decimals, + maximumFractionDigits: decimals, + useGrouping + }) +} + diff --git a/src/components/risultati/B_BAR.vue b/src/components/risultati/B_BAR.vue index c498117..e59fe17 100644 --- a/src/components/risultati/B_BAR.vue +++ b/src/components/risultati/B_BAR.vue @@ -28,8 +28,8 @@ {{ row.verbale }} {{ formatDate(row.dataPrelievo) }} {{ formatNumber(row.diaNom,0) }} - {{ formatNumber(row.lunBase,2) }} - {{ formatNumber(row.masG,2) }} + {{ formatNumber(row.lunBase,0) }} + {{ formatNumber(row.masG,1) }} {{ formatNumber(row.diaEff,2) }} {{ row.ferriera }} {{ row.area }} @@ -60,10 +60,10 @@ {{ row.idProvino }} {{ formatNumber(row.carsne,2) }} - {{ formatNumber(row.tensne,2) }} + {{ formatNumber(row.tensne,1) }} {{ formatNumber(row.carot,2) }} - {{ formatNumber(row.tenrot,2) }} - {{ formatNumber(row.agt,2) }} + {{ formatNumber(row.tenrot,1) }} + {{ formatNumber(row.agt,1) }} {{ formatNumber(row.ftFy,2) }} {{ formatNumber(row.ftFyNom,2) }} {{ formatNumber(row.mandrino,0) }} @@ -84,14 +84,14 @@ return new Date(dateStr).toLocaleDateString('it-IT') } - function formatNumber(val, decimals) { - return val != null - ? Number(val).toLocaleString('it-IT', { - minimumFractionDigits: decimals, - maximumFractionDigits: decimals - }) - : '—' - } +function formatNumber(val, decimals = 2, useGrouping = false) { + if (val == null) return '—' + return Number(val).toLocaleString('it-IT', { + minimumFractionDigits: decimals, + maximumFractionDigits: decimals, + useGrouping + }) +} diff --git a/src/components/risultati/B_RET.vue b/src/components/risultati/B_RET.vue index c7a4972..c47437d 100644 --- a/src/components/risultati/B_RET.vue +++ b/src/components/risultati/B_RET.vue @@ -87,14 +87,14 @@ return new Date(dateStr).toLocaleDateString('it-IT') } - function formatNumber(val, decimals) { - return val != null - ? Number(val).toLocaleString('it-IT', { - minimumFractionDigits: decimals, - maximumFractionDigits: decimals - }) - : '—' - } +function formatNumber(val, decimals = 2, useGrouping = false) { + if (val == null) return '—' + return Number(val).toLocaleString('it-IT', { + minimumFractionDigits: decimals, + maximumFractionDigits: decimals, + useGrouping + }) +}