Odoo Help

2

1
1 Answer
2
Prajul P T India
11/20/13, 8:28 AM

This is the code in js for displaying value in float_time format:

case 'float_time':
    var pattern = '%02d:%02d';
    if (value < 0) {
        value = Math.abs(value);
        pattern = '-' + pattern;
    }
    var hour = Math.floor(value);
    var min = Math.round((value % 1) * 60);
    if (min == 60){
        min = 0;
        hour = hour + 1;
    }
    return _.str.sprintf(pattern, hour, min);

So in your case, in db it is stored as 0.16666667. So the min will be var min = Math.round((0.16666667 % 1) * 60); which will be 10 when rounded...

Ask a Question
Keep Informed
1 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now