objective c - How do you get the int and modulo (mod) of division with an NSDecimalNumber -


I NSDecimalNumber and confused by its "behavior" I have a NSDecimalNumber which represents the dollar value, $ 37.50 Says. I have to find out how many times 5.0 says that goes in number and then know what is left. I can get a direct division and get 7.50, but I need 7 mode 2.50. I may be converted to an integer I, but "Saints" a few tricks in need of saving is that thinking?

itemprop = "text">

Using Peter Hoshes example, but with IOS code:

  Ansdisikmnanbr * Dividends = [Ansdisimlnmber Dsmlvsmuhvidth Disiml: [[Ansanmber Snkyawadatmk repeating: 37.5] Dsmlvvol]]; NSDecimalNumber * divisor = [NSDecimalNumber Dsmlvsmuhvidth Dsmlwata: [[Ansanmber Snkyawadatmk repeating: 5.0] Dsmlvmuly]]; NSDecimalNumber * quotient = [dividend decimal by Snkyabindubajit: Bivier with denominator: [Ansdisimlnanbrhandlr decimal decimal Snkyahandlrvithroundingmod: Ansarunddaun scale: 0 raiseOnExactness: not raiseOnVerflow: No raiseOnUnderflow: No raiseOnDivideByZero: No]]; NSDecimalNumber * subtractAmount = [Rate Decimal Decimal Numberwise Base: Divider]; NSDecimalNumber * Balance = [Dividend DeviationBisposting: Decrease Amount];  

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -