2
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-08-22 10:09:39 +00:00

Cleanup `Localization` formatting

This commit is contained in:
litetex 2025-07-26 15:43:46 +02:00 committed by Stypox
parent 859555e129
commit 70841db92f
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23

View File

@ -127,14 +127,13 @@ public final class Localization {
} }
public static String localizeNumber(final double number) { public static String localizeNumber(final double number) {
final NumberFormat nf = NumberFormat.getInstance(getAppLocale()); return NumberFormat.getInstance(getAppLocale()).format(number);
return nf.format(number);
} }
public static String formatDate(@NonNull final OffsetDateTime offsetDateTime) { public static String formatDate(@NonNull final OffsetDateTime offsetDateTime) {
return DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM) return DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM)
.withLocale(getAppLocale()).format(offsetDateTime .withLocale(getAppLocale())
.atZoneSameInstant(ZoneId.systemDefault())); .format(offsetDateTime.atZoneSameInstant(ZoneId.systemDefault()));
} }
@SuppressLint("StringFormatInvalid") @SuppressLint("StringFormatInvalid")