views:

68

answers:

1

I'm trying to take a numeric value in a string and raise it by a power of 10. stumbled upon – decimalNumberByMultiplyingByPowerOf10:withBehavior: which looks promising but I can't for the life of me figure out how to configure/set the withBehavior argument. I think I need to set it to NSRoundDown so when raising to negative power it won't round 'up' some values below a certain number of decimal places...but how does one set/use this NSDecimalNumberBehaviors gizmo? Sure wish Apple provided some examples in their docs...

+1  A: 

Check out NSDecimalNumberHandler. It conforms to the NSDecimalNumberBehaviors protocol, as required by the API, and allows you to configure all the behaviors you're likely to need.

Matt Ball
Hadn't used it before so was a little "afraid" but was able to pull it off w/out a hitch! thx.
Meltemi