odoo-13.0/addons/web/static/src/js/fields/field_utils.js
/**
 * Returns a string representing an integer.  If the value is false, then we
 * return an empty string.
 *
 * @param {integer|false} value
 * @param {Object} [field]
 *        a description of the field (note: this parameter is ignored)
 * @param {Object} [options] additional options
 * @param {boolean} [options.isPassword=false] if true, returns '********'
 * @param {function} [options.humanReadable] if returns true,
 *   formatFloat acts like utils.human_number
 * @returns {string}
 */
Returns a string representing an integer.  If the value is false, then we
return an empty string.


Returns a string representing an integer . If the value is false then we return an empty string .
function formatInteger(value, field, options) {
    options = options || {};
    if (options.isPassword) {
        return _.str.repeat('*', String(value).length);
    }
    if (!value && value !== 0) {
        return "";
    }
    if (options.humanReadable && options.humanReadable(value)) {
        return utils.human_number(value, options.decimals, options.minDigits, options.formatterCallback);
    }
    return utils.insert_thousand_seps(_.str.sprintf('%d', value));
}
function formatInteger ( value , field , options ) { options = options || { } ; if ( options . isPassword ) { return _ . str . repeat ( '*' , String ( value ) . length ) ; } if ( ! value && value !== 0 ) { return "" ; } if ( options . humanReadable && options . humanReadable ( value ) ) { return utils . human_number ( value , options . decimals , options . minDigits , options . formatterCallback ) ; } return utils . insert_thousand_seps ( _ . str . sprintf ( '%d' , value ) ) ; }
Returns a string representing an integer.
Returns a string representing an integer .
// previously, it returned 'false'. I don't know why.  But for the Pivot // view, I want to display the concept of 'no value' with an empty // string.