danthorpe / Money

Swift value types for working with money & currency
MIT License
933 stars 91 forks source link

How to use DecimalNumberBehaviorType? #78

Open jyunglai opened 7 years ago

jyunglai commented 7 years ago

This might be a simple question. I'm trying to figure out how to change the behavior of the Money class. Usually with NSDecimalNumber you would create a handler and apply the behavior. I seen to be having a hard time doing so with this class. Of course, I'm probably doing something wrong.

Example: let cost:Money = 200.00 let num = 3 let each = cost / 3

If I want to round down "each", how should I do so?

Thanks!