static/js/interface.js
/**
 * Format a value to be a label depending on content.
 * @function formatValueLabel
 * @param {number} value - value to format
 * @param {number} icol - column index
 * @param {number} digits - number of digits to keep
 * @param {boolean} unit - whether to keep unit if available
 * @param {Object} mo - main object
 */
Format a value to be a label depending on content.
Format a value to be a label depending on content .
function formatValueLabel(value, icol, digits, unit, mo) {
  const ilen = mo.cache.splen;
  if (ilen && icol === ilen) {
    const fmtlen = FormatLength(value);
    let res = formatNum(fmtlen[0], digits);
    if (unit) res += ' ' + fmtlen[1];
    return res;
  } else {
    return formatNum(value, digits);
  }
}
function formatValueLabel ( value , icol , digits , unit , mo ) { const ilen = mo . cache . splen ; if ( ilen && icol === ilen ) { const fmtlen = FormatLength ( value ) ; let res = formatNum ( fmtlen [ 0 ] , digits ) ; if ( unit ) res += ' ' + fmtlen [ 1 ] ; return res ; } else { return formatNum ( value , digits ) ; } }
Format a value to be a label depending on content.
Format a value to be a label depending on content .