Ive read about typescript number type is floating point and may result in errors when used in financial programs where numbers are represented to two decimal places. I realize I can use longs are represent everything in cents, but its tedious to do currency multiplication because $1.00 x $1.00 = $10.00 for example unless you remember to divide by 10^(n*2) where n is the number of currency factors.
I was thinking I could maybe just use something like:
let result = [some floating math with dollar amounts]
let answer1 = Math.round(result * 100) / 100;
For my application which is dealing in $ amounts not to exceed say $100MM, it seems like it will suffice to errors like $2.00 x 20% x 10% != $0.04
but I'm not sure this will work in all the cases that might produce similar errors when I am doing a lot of math on currency amounts in my application.