Cocoa Basic bundle question - NSDecimalNumberBy ...: withBehavior:

I'm trying to take a numeric value in a string and bump it up by force 10. Stumbled upon - decimalNumberByMultiplyingByPowerOf10: withBehavior: looks promising, but I can't forever figure out how to set / set the withBehavior argument. I think I need to set it to NSRoundDown, so when it goes up to negative cardinality it won't round "some" values โ€‹โ€‹below a certain number of decimal places ... but how to set / use this NSDecimalNumberBehaviors gizmo? Of course, Apple provided several examples in their docs ...

+1


a source to share


1 answer


Departure NSDecimalNumberHandler

. It conforms to the protocol NSDecimalNumberBehaviors

as required by the API and allows you to customize all the behaviors you are likely to need.



+1


a source







All Articles