I always want to want to round up. So 3.45 will become 4.
3.1 will be 4.
7.1 will be 8
Always up to the next never down. I read somewhere I need to be using math.ceil. reading up on that now
I also seen below trying to figure out how to use it though. I tried
from openerp.tools.float_utils import float_round
rolls_required = fields.float_round("Rolls Required", precision_digits=1, rounding_method='UP')
But I get TypeError: unsupported operand type(s) for /: 'str' and 'float'
// function for rounding numbers
from openerp.tools.float_utils import float_round // importing
// value - float number
// precision_digits - number of fractional digits to round to
// precision_rounding - decimal number representing the minimum non-zero value at the desired precision
// rounding_method - can be 'HALF-UP' or 'UP'
value1 = float_round(10.005, precision_digits=2, precision_rounding=None, rounding_method='HALF-UP')
value2 = float_round(10.005, precision_digits=None, precision_rounding=2, rounding_method='HALF-UP')
value3 = float_round(10.005, precision_digits=2, precision_rounding=None, rounding_method='UP')
value4 = float_round(10.005, precision_digits=None, precision_rounding=2, rounding_method='UP')
But it’s working for me like when value is 3.45 than it’s show 3 and if value js 3.51 than it will be show 4
Hello. Did you solved? how you did it? i want to print values rounded up (ceiling) but I don´t know how to do it. In my case is just for PDF purpouses. Thanks