[javascript] javascript: calculate x% of a number