Decimal value assetion in q-unit
I really hope this wasn't asked before... i really couldn't find anything :S...
How do I assert correct decimal value with a bit of tolerance?
Lets say I want to assert this:
1 / 3
I don't want to assert this with a long string like this: equal(1 / 3, 0.3333333333333333)
I would like to specify tolerance for it like this: equal(1 / 3, 0.33, 0.01) // As in... value can be from 0.32 to 0.34
Is this possible in q-unit? One possible solution to this would be if i multiplied the result by like 1000 and cut away all the decimal places... But i will be writing many such tests and would prefer to use any already implemented feature of q-unit is possible.
Thank you for your answers!
Regards, Erik