Skip to content
Snippets Groups Projects
Commit 71181557 authored by David Smadja's avatar David Smadja
Browse files

Round values to second decimal

parent f9e4a981
No related branches found
No related tags found
No related merge requests found
Pipeline #19880 passed
......@@ -191,6 +191,8 @@ function removeZeroValuesAndExcludedVariables(obj: any): any {
if (Object.keys(cleanedValue).length > 0) {
newObj[key] = cleanedValue
}
} else if (typeof value === "number") {
newObj[key] = Math.round(value * 100) / 100
} else {
newObj[key] = value
}
......@@ -421,7 +423,7 @@ function replaceVariableValue(
console.info(
`Replacing ${variableName} (${period}): ${variableData[period]}${newValue}`,
)
variableData[period] = Number(newValue)
variableData[period] = Math.round(Number(newValue) * 100) / 100
} else {
console.log(
"Warning : rounded value",
......@@ -493,7 +495,8 @@ async function runOpenFiscaTest(
resolve(returned)
} else
reject(
"Erreur de récupération des valeurs lors d'un appel à openfisca test",
"Erreur de récupération des valeurs lors d'un appel à openfisca test : " +
testOutput,
)
} else {
returned = { passed: true }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment