mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-08-22 10:09:39 +00:00
Cleanup `Localization
` formatting
This commit is contained in:
parent
859555e129
commit
70841db92f
@ -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")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user