Apr-12-2020, 10:59 AM
OK, int() is not random, obviously.
But i pointed out that " we may be distributing a series of costs over eg. 5 departments",
each cost divided by 5 wil produce a different decimal.
Sometimes less than .50 sometimes .50 or more.
That fact is random because the list of costs is what it is, all different, resulting in different decimal results.
So you may want to round to the nearest integer, if that is the company policy.
The only way i know is: to add to the result of the division 0.50
I'm sure that if < .050 do int() and if >.49 do ceil() is a non-starter. :-)
The only thing i want to know is, if i missed something.
Python offers something like ceil() which i can easily reproduce by doing int(x.y + 1)
Do we have something that will give the nearest integer ?
thx,
Paul
But i pointed out that " we may be distributing a series of costs over eg. 5 departments",
each cost divided by 5 wil produce a different decimal.
Sometimes less than .50 sometimes .50 or more.
That fact is random because the list of costs is what it is, all different, resulting in different decimal results.
So you may want to round to the nearest integer, if that is the company policy.
The only way i know is: to add to the result of the division 0.50
I'm sure that if < .050 do int() and if >.49 do ceil() is a non-starter. :-)
The only thing i want to know is, if i missed something.
Python offers something like ceil() which i can easily reproduce by doing int(x.y + 1)
Do we have something that will give the nearest integer ?
thx,
Paul