# unit tests

The whole point of the OP code is to compute different results than
[FP](https://en.wikipedia.org/wiki/IEEE_754#Formats) would,
a subtle difference that is challenging to see when
just eyeballing some source code. 
This would have been stronger submission if accompanied by an
[automated test suite](https://jestjs.io).
As written, you are asking "did I follow a Big invocation pattern?"
rather than "did I get the result correct down to the penny?"

# specification

The OP code does not tell us the magnitudes it is expected
to correctly operate upon, e.g. should this get the U.S. national debt
correct to the penny?

# consistently use same rounding mode

```
    const final = total.round(0, Big.roundHalfUp)...

    const final = total.round(0, Big.roundHalfUp)...

    return subTotal.round(0, Big.roundHalfUp)...

    return total.round(0, Big.roundHalfUp)...

    const final = total.round(0, Big.roundHalfUp)...
```

The documentation explains that

> ... the rounding mode used to round the results of these methods is determined by the value of the ... RM propert[y] of the Big number constructor.

```
Big.RM = Big.roundHalfUp
```

Even if you chose not to set the `RM`,
all those copy-pasta code fragments plus comment
would belong in a `roundToCents()` helper.