Skip to content

Commit

Permalink
fix: change the toFixed to 2
Browse files Browse the repository at this point in the history
  • Loading branch information
jvJUCA committed Apr 19, 2024
1 parent 14a8eb3 commit 6f885c4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/utils/statistics.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function calcFinalResult(array) {
})

const perfectResult = (qtdQuestion - qtdNoAplication) * maxOption
return ((result * 100) / perfectResult).toFixed(1)
return ((result * 100) / perfectResult).toFixed(2)
}

function answers() {
Expand Down Expand Up @@ -139,19 +139,19 @@ function finalResult() {
return total + value.result / evaluatorStatistics.items.length
}, 0)

testData.average = `${Math.fround(res).toFixed(1)}%`
testData.average = `${Math.fround(res).toFixed(2)}%`

testData.max = `${Math.max(
...evaluatorStatistics.items.map((item) => item.result),
).toFixed(1)}%`
).toFixed(2)}%`

testData.min = `${Math.min(
...evaluatorStatistics.items.map((item) => item.result),
).toFixed(1)}%`
).toFixed(2)}%`

testData.sd = `${standardDeviation(
evaluatorStatistics.items.map((item) => item.result),
).toFixed(1)}%`
).toFixed(2)}%`
}
return testData
}
Expand Down

0 comments on commit 6f885c4

Please sign in to comment.