Cleanup `Localization` formatting
This commit is contained in:
parent
9e2e6f211d
commit
6ac5acd9ff
1 changed files with 3 additions and 4 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue