python - Rounding up a value to next int -
i need make paint program rounds next gallon, having problem. when said in done, lets height 96, width 240, , length 200, equals out 919 feet. subtract few walls , windows , have 832 square feet. divide 200 , gives me 4.3 can't have 4.3 gallons of paint, need rounded 5. code below though, round out 4. simple, , easy fix help?
primer_area = (2*(length * height) + 2*(width*height)) / 144 primer_needed = (primer_area + result - door_area - window_area) / 200 # primer rounded next gallon primer = primer_needed primer = math.ceil(primer)
i think if change these lines work
primer_needed = float(primer_area + result - door_area - window_area) / 200 primer_needed = float(primer_area + result - door_area - window_area) / 200
or can determine result float like
x = float
Comments
Post a Comment