Generates percent value
171881
function (count, total, rounded) {
        var scale;
        if (rounded) {
            scale = this._0digitsScale;
        } else {
            scale = this._2digitsScale;
        }
        return Math.floor(this._percentage * scale * count / total) / scale;
    }
854559
def format_percent_field(__, prec, number, locale):
    """"""
    prec = PERCENT_DECIMAL_DIGITS if prec is None else int(prec)
    locale = Locale.parse(locale)
    pattern = locale.percent_formats.get(None)
    return pattern.apply(number, locale, force_frac=(prec, prec))
715348
def _bar(self, target_name, current, total):
        
        bar_len = 30

        if total is None:
            state = 0
            percent = "?% "
        else:
            total = int(total)
            state = int((100 * current) / total) if current < total else 100
            percent = str(state) + "% "

        if self._n_total > 1:
            num = "({}/{}): ".format(self._n_finished + 1, self._n_total)
        else:
            num = ""

        n_sh = int((state * bar_len) / 100)
        n_sp = bar_len - n_sh
        pbar = "[" + "#" * n_sh + " " * n_sp + "] "

        return num + pbar + percent + target_name
909628
function(opts) {
		size = opts.size || 120;
		format = opts.format || 'percent';
		container = opts.container || document.body;
		endValue = opts.endValue;
		value = opts.value || 0;
	}
1161855
function percentEncode (value) {
    var result = encodeURIComponent(value);
    return result.replace(/\!/g, "%21")
                 .replace(/\'/g, "%27")
                 .replace(/\(/g, "%28")
                 .replace(/\)/g, "%29")
                 .replace(/\*/g, "%2A");
}
722565
def percentAt(self, value):
        
        min_val = self.minimum()
        max_val = self.maximum()
        
        if value < min_val:
            return 0.0
        elif max_val < value:
            return 1.0
        
        # round the max value to sync with the values in the grid
        max_val = self.rounded(max_val)
        
        try:
            perc = (value - min_val) / float(max_val - min_val)
        except (TypeError, ZeroDivisionError):
            return 0.0
        
        return max(min(perc, 1.0), 0.0)
537978
def _assert_is_percentage(value, maximum=100):
    

    if value < 0 or value > maximum:
        message = 'The value on a percentage field should be between 0 and %s' \
                  % maximum
        raise pp.ParseException(message)
1175535
function (percent) {
            var rounded = Math.round(percent / this.coords.p_step) * this.coords.p_step;

            if (rounded > 100) {
                rounded = 100;
            }
            if (percent === 100) {
                rounded = 100;
            }

            return this.toFixed(rounded);
        }
1075824
function percentEscape(value) {

    // Percent-escape per specification

    var escapedString = '';

    for (var i = 0; i < value.length; i++) {

        var char = value.charCodeAt(i);

        if ((char >= 48 && char <= 57) ||       // 09
            (char >= 65 && char <= 90) ||       // AZ
            (char >= 97 && char <= 122) ||      // az
            char == 45 ||                       // -
            char == 95 ||                       // _
            char == 46 ||                       // .
            char == 126) {                      // ~

            escapedString += String.fromCharCode(char);
        }
        else {

            escapedString += '%' + char.toString(16).toUpperCase();
        }
    }

    return escapedString;
}
946695
public static String percentageBar(double percentage) {
        final char  dot   = '.';
        final char  mark  = '#';
        final int   slots = 40;

        StringBuilder bar = new StringBuilder(replicate(String.valueOf(dot), slots));
        int numSlots = (int) (slots * percentage / 100.0);
        for (int k = 0; k < numSlots; ++k) bar.setCharAt(k, mark);

        return String.format("[%s] %3.0f%%", bar, percentage);
    }
804170
function() {
            var
              barWidth       = $bar.width(),
              totalWidth     = $module.width(),
              minDisplay     = parseInt($bar.css('min-width'), 10),
              displayPercent = (barWidth > minDisplay)
                ? (barWidth / totalWidth * 100)
                : module.percent
            ;
            return (settings.precision > 0)
              ? Math.round(displayPercent * (10 * settings.precision)) / (10 * settings.precision)
              : Math.round(displayPercent)
            ;
          }
166009
function setByPercentage(callback) {
    var percentage = 0;
    
    var setByPercentageInterval = setInterval(function() {
        if (percentage <= 100) {
            dot3k.barGraph.setByPercentage(percentage);
            
            percentage++;
        } else {
            clearInterval(setByPercentageInterval);
            
            if (callback) {
                callback();
            }
        }
    }, 50);
}
46801
function(n) {
			var a = (n === Math.floor(n)) ? n : (Math.round(n*100))/100;
			return (a + "%");
		}
1293872
def formatPercent( value, options = nil )
      if value
         percent = (value.to_f * 100)
         value = percent.to_s
         if value.include?(".")
            int,fraction = value.split('.')
            if fraction.to_i == 0
               value = int
            else
               value = "#{int}.#{fraction[0,2]}"
            end            
         end         
      else
         value = "0"
      end
      value
   end
452168
function(percentage) {
					var min = (this.options.min === 0) ? 0 : Math.log(this.options.min);
					var max = Math.log(this.options.max);
					var value = Math.exp(min + (max - min) * percentage / 100);
					value = this.options.min + Math.round((value - this.options.min) / this.options.step) * this.options.step;
					/* Rounding to the nearest step could exceed the min or
					 * max, so clip to those values. */
					if (value < this.options.min) {
						return this.options.min;
					} else if (value > this.options.max) {
						return this.options.max;
					} else {
						return value;
					}
				}
10879
static String toBar(double percentValue) { // NOPMD
		final double myPercent = Math.max(Math.min(percentValue, 100d), 0d);
		final StringBuilder sb = new StringBuilder();
		final String body = "<img src=''?resource=bar/rb_{0}.gif'' alt=''+'' title=''"
				+ I18N.createPercentFormat().format(myPercent) + "%'' />";
		final int fullBlockCount = (int) Math.floor(myPercent / (UNIT_SIZE * PARTIAL_BLOCKS));
		final int partialBlockIndex = (int) Math
				.floor((myPercent - fullBlockCount * UNIT_SIZE * PARTIAL_BLOCKS) / UNIT_SIZE);

		sb.append(MessageFormat.format(body,
				fullBlockCount > 0 || partialBlockIndex > 0 ? "a" : "a0"));

		final String fullBody = MessageFormat.format(body, PARTIAL_BLOCKS);
		for (int i = 0; i < fullBlockCount; i++) {
			sb.append(fullBody);
		}

		if (partialBlockIndex > 0) {
			final String partialBody = MessageFormat.format(body, partialBlockIndex);
			sb.append(partialBody);
		}

		final int emptyBlocks = FULL_BLOCKS - fullBlockCount - (partialBlockIndex > 0 ? 1 : 0);
		final String emptyBody = MessageFormat.format(body, 0);
		for (int i = 0; i < emptyBlocks; i++) {
			sb.append(emptyBody);
		}

		sb.append(MessageFormat.format(body, fullBlockCount == FULL_BLOCKS ? "b" : "b0"));
		return sb.toString();
	}
111217
def _generate_limit_items(lower, upper):
    
    # Use value + 0 to convert any -0.0 to 0.0 which looks better.
    if lower is not None and upper is not None and lower == upper:
        yield 'fixed', upper + 0
    else:
        if lower is not None:
            yield 'lower', lower + 0
        if upper is not None:
            yield 'upper', upper + 0