public static String trimTrailingZerosAfterDecimal(String buffer, boolean localized) {
		if (buffer != null) {
			buffer = buffer.trim();
			int dot = buffer.indexOf(localized ? DecimalFormatSymbols.getInstance().getDecimalSeparator() : '.');
			if (dot != -1) {
				int pos = buffer.length() - 1;
				while (true) {
					if (buffer.charAt(pos) != '0') {
						break;
					}
					pos--;
				}
				if (dot != pos) {
					pos++;
				}
				buffer = buffer.substring(0, pos);
			}
		}
		return buffer;
	}