This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author AaronR
Recipients AaronR, ArneBab, mark.dickinson, r.david.murray, skrah, vstinner
Date 2011-10-07.20:22:45
SpamBayes Score 0.006185223
Marked as misclassified No
Message-id <1318018966.2.0.394454852021.issue13060@psf.upfronthosting.co.za>
In-reply-to
Content
When i run into I have to bodge around it in ways like the below code.

I've only ever used round half up, has anyone here even used Bankers Rounding by choice before?

For reference here are the other options: http://en.wikipedia.org/wiki/Rounding#Tie-breaking

def RoundHalfUp(number):
  '''http://en.wikipedia.org/wiki/Rounding#Round_half_up
  0.5 and above round up else round down.
  '''
  trunc = int(number)
  fractionalPart = number - trunc
  if fractionalPart < 0.5:
    return trunc
  else:
    ceil = trunc + 1
    return ceil
History
Date User Action Args
2011-10-07 20:22:46AaronRsetrecipients: + AaronR, mark.dickinson, vstinner, r.david.murray, skrah, ArneBab
2011-10-07 20:22:46AaronRsetmessageid: <1318018966.2.0.394454852021.issue13060@psf.upfronthosting.co.za>
2011-10-07 20:22:45AaronRlinkissue13060 messages
2011-10-07 20:22:45AaronRcreate