function _trim(str) {
    return str.replace(/^\s+|\s+$/g, '');
}
Get a data of given precision, assuring the sum of percentages
in valueList is 1.
The largest remainer method is used.
https://en.wikipedia.org/wiki/Largest_remainder_method

@param {Array.<number>} valueList a list of all data
@param {number} idx index of the data to be processed in valueList
@param {number} precision integer number showing digits of precision
@return {number} percent ranging from 0 to 100