Skip to content

Commit

Permalink
Fix comma at the end of address field
Browse files Browse the repository at this point in the history
fixes #359
  • Loading branch information
johan12345 committed Sep 14, 2024
1 parent 9d196f6 commit ce618f8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/src/main/java/net/vonforst/evmap/model/ChargersModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -371,14 +371,15 @@ data class Address(
override fun toString(): String {
// TODO: the order here follows a German-style format (i.e. street, postcode city).
// in principle this should be country-dependent (e.g. UK has postcode after city)
// maybe use https://github.com/bettermile/address-formatter-kotlin
return buildString {
street?.let {
append(it)
append(", ")
if (postcode != null || city != null) append(", ")
}
postcode?.let {
append(it)
append(" ")
if (city != null) append(" ")
}
city?.let {
append(it)
Expand Down

0 comments on commit ce618f8

Please sign in to comment.