Skip to content
Snippets Groups Projects
Commit 3034968f authored by Gomez Goiri, Aitor's avatar Gomez Goiri, Aitor
Browse files

Beautifying stat table

parent e388e7be
No related branches found
No related tags found
No related merge requests found
...@@ -39,7 +39,7 @@ const humanizePercentage = value => { ...@@ -39,7 +39,7 @@ const humanizePercentage = value => {
if (value.percentage === undefined) { if (value.percentage === undefined) {
return value.total return value.total
} }
return `${value.total} (%${value.percentage})` return `${value.total} [%${value.percentage.toFixed(2)}]`
} }
const humanizePrice = value => `${value.avg} [${value.min}, ${value.max}]` const humanizePrice = value => `${value.avg} [${value.min}, ${value.max}]`
...@@ -52,14 +52,13 @@ const toLine = stat => [ ...@@ -52,14 +52,13 @@ const toLine = stat => [
const getStats = async apiClient => { const getStats = async apiClient => {
const stats = await apiClient.getStats() const stats = await apiClient.getStats()
// console.log("Stats", stats)
const tableValues = [ const tableValues = [
[ [
"", "",
"Total slag \n (t)", "Total slag\nt",
"Reused\nt (%)", "Reused\nt [%]",
"Discarded\nt (%)", "Discarded\nt [%]",
"Price (€)\n Avg [Min, Max]" "Price (€)\n Avg [Min, Max]"
], ],
...Object.entries(stats.perCompany || []).map(([org, val]) => [ ...Object.entries(stats.perCompany || []).map(([org, val]) => [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment