fix: recovery daily test reporting of uT was rounding incorrectly
Description
This PR deals with a reported float T value correctly in the report.
How Has This Been Tested?
UNTESTED!
@@ -87,10 +87,13 @@ async function run(options = {}) {
let scannedMatch = data.match(RECOVERY_COMPLETE_REGEXP);
let recoveredAmountMatch = data.match(RECOVERY_WORTH_REGEXP);
if (scannedMatch && recoveredAmountMatch) {
- let recoveredAmount = parseInt(recoveredAmountMatch[1]);
+ // JS probably doesn't care but rust would!
+ let recoveredAmount = 0;
if (recoveredAmountMatch[2] === "T") {
// convert to micro tari
- recoveredAmount *= 1000000;
+ recoveredAmount = round(parseFloat(recoveredAmountMatch[1]) * 1000000);
+ } else {
+ recoveredAmount = parseInt(recoveredAmountMatch[1]);
}
return {
numScanned: parseInt(scannedMatch[1]),
