class CallStackElement {

	static String printPercentAsBar(double percent, int totalBars, boolean asciiArt) {
		int actualBars = (int) (percent * totalBars);
		boolean includeHalfBarAtEnd = actualBars * 2 != (int) (percent * totalBars * 2);
		StringBuilder sb = new StringBuilder(totalBars);
		for (int i = 0; i < totalBars; i++) {
			if (i < actualBars) {
				sb.append(asciiArt ? (char) 9608 : '|');
			} else if (i == actualBars && includeHalfBarAtEnd) {
				sb.append(asciiArt ? (char) 9619 : ':');
			} else {
				sb.append(asciiArt ? (char) 9617 : '-');
			}
		}
		return sb.toString();
	}

}