srecord Percent(double percent) { void set(double percent) { percent = percent; } double get() { ret percent; } toString { ret percent + " %"; } S renderWithDecimals aka withDecimals(int decimals) { ret formatDouble(percent, decimals) + " %"; } S withExactDecimals(int decimals) { ret formatDoubleX(percent, decimals) + " %"; } S oneDecimal() { ret withDecimals(1); } S exactlyOneDecimal() { ret withExactDecimals(1); } static Percent ratio(double x, double y) { ret new Percent(doubleRatio(x, y)*100); } }