src/main/java/de/dennisguse/opentracks/services/announcement/VoiceAnnouncementUtils.java
private static void appendDecimalUnit(@NonNull SpannableStringBuilder builder, @NonNull String localizedText, long integerPart, @Nullable String fractionalPart, @NonNull String unit) {
        TtsSpan.MeasureBuilder measureBuilder = new TtsSpan.MeasureBuilder()
                .setUnit(unit);

        if (fractionalPart == null) {
            measureBuilder.setNumber(integerPart);
        } else {
            measureBuilder.setIntegerPart(integerPart)
                    .setFractionalPart(fractionalPart);
        }

        builder.append(" ")
                .append(localizedText, measureBuilder.build(), SPAN_INCLUSIVE_EXCLUSIVE);
    }
/**
     * Speaks as: 98.14 [UNIT] - ninety eight point one four [UNIT with correct plural form]
     */
Speaks as: 98.14 [UNIT] - ninety eight point one four [UNIT with correct plural form]
Speaks as : 98 . 14 [ UNIT ] - ninety eight point one four [ UNIT with correct plural form ]
private static void appendDecimalUnit(@NonNull SpannableStringBuilder builder, @NonNull String localizedText, long integerPart, @Nullable String fractionalPart, @NonNull String unit) {
        TtsSpan.MeasureBuilder measureBuilder = new TtsSpan.MeasureBuilder()
                .setUnit(unit);
        if (fractionalPart == null) {
            measureBuilder.setNumber(integerPart);
        } else {
            measureBuilder.setIntegerPart(integerPart)
                    .setFractionalPart(fractionalPart);
        }
        builder.append(" ")
                .append(localizedText, measureBuilder.build(), SPAN_INCLUSIVE_EXCLUSIVE);
    }
private static void appendDecimalUnit ( @ NonNull SpannableStringBuilder builder , @ NonNull String localizedText , long integerPart , @ Nullable String fractionalPart , @ NonNull String unit ) { TtsSpan . MeasureBuilder measureBuilder = new TtsSpan . MeasureBuilder ( ) . setUnit ( unit ) ; if ( fractionalPart == null ) { measureBuilder . setNumber ( integerPart ) ; } else { measureBuilder . setIntegerPart ( integerPart ) . setFractionalPart ( fractionalPart ) ; } builder . append ( " " ) . append ( localizedText , measureBuilder . build ( ) , SPAN_INCLUSIVE_EXCLUSIVE ) ; }
Speaks as: 98.14 [UNIT] - ninety eight point one four [UNIT with correct plural form]
Speaks as : 98 . 14 [ UNIT ] - ninety eight point one four [ UNIT with correct plural form ]