I’m testing a system where is specific rounding – last number is always rounded up
e.g.
123,459should yield123,4699,9911should yield100,00
How can I implement it in python?
EDIT
The most important thing – those numbers are prices
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Note that due to floating point not being able to express all decimal fractions, some results won’t be able to be expressed in floating point numbers. If this is an issue, calculate in fixed-point numbers (i.e. 1.23 is represented by
123, with a fixed factor of0.01), or usedecimal.Decimal.