/** * <p>Converts given integer to a text numeral. </p> * * @param number number to be displayed as text * @return text numeral * @throws IllegalArgumentException if the conversion is not supported for given number * @since 3.11/4.8 */ /*[deutsch] * <p>Konvertiert die angegebene Zahl zu einem Textnumeral. </p> * * @param number number to be displayed as text * @return text numeral * @throws IllegalArgumentException if the conversion is not supported for given number * @since 3.11/4.8 */ public String toNumeral(int number) { if (this.isDecimal() && (number >= 0)) { int delta = this.getDigits().charAt(0) - '0'; String standard = Integer.toString(number); StringBuilder numeral = new StringBuilder(); for (int i = 0, n = standard.length(); i < n; i++) { int codepoint = standard.charAt(i) + delta; numeral.append((char) codepoint); } return numeral.toString(); } else { throw new IllegalArgumentException("Cannot convert: " + number); } }
) { if (this.isDecimal()) { int delta = this.getDigits().charAt(0) - '0'; StringBuilder standard = new StringBuilder();
/** * <p>Defines the localized zero digit based on given decimal number system. </p> * * @param numberSystem decimal number system * @return changed copy of this instance * @throws IllegalArgumentException if the number system is not decimal * @see #withZeroDigit(char) * @since 3.24/4.20 */ /*[deutsch] * <p>Definiert die lokalisierte Nullziffer, indem das angegebene Dezimalzahlsystem ausgewertet wird. </p> * * @param numberSystem decimal number system * @return changed copy of this instance * @throws IllegalArgumentException if the number system is not decimal * @see #withZeroDigit(char) * @since 3.24/4.20 */ public PrettyTime withZeroDigit(NumberSystem numberSystem) { if (numberSystem.isDecimal()) { return this.withZeroDigit(numberSystem.getDigits().charAt(0)); } else { throw new IllegalArgumentException("Number system is not decimal: " + numberSystem); } }
if (numsys.isDecimal()) { this.set(Attributes.ZERO_DIGIT, numsys.getDigits().charAt(0));