$ node
> var Cents = require('goodeggs-money')
> var tenDollars = new Cents(1000)
undefined
> tenDollars.dividedBy(tenDollars)
BigNumber Error: new BigNumber() not a number: $10.00
at raise (/Users/bryce/node_modules/bignumber.js/bignumber.js:1181:25)
at /Users/bryce/node_modules/bignumber.js/bignumber.js:1169:33
at new BigNumber (/Users/bryce/node_modules/bignumber.js/bignumber.js:195:67)
at BigNumber.P.dividedBy.P.div (/Users/bryce/node_modules/bignumber.js/bignumber.js:1455:31)
at Cents.module.exports.Cents.dividedBy (/Users/bryce/node_modules/goodeggs-money/lib/index.js:127:33)
at repl:1:12
at REPLServer.defaultEval (repl.js:252:27)
at bound (domain.js:287:14)
at REPLServer.runBound [as eval] (domain.js:300:12)
at REPLServer.<anonymous> (repl.js:417:12)
Repro case:
I was able to get it working thusly:
Given that the README indicates it safe to rewrap Cents, I assumed that
dividedBy
another Cents would work too.