Settings: price display toggle — station sign (£129.9) vs pounds & pence (£1.299); display-only, all surfaces (list, widgets, Live Activity, Siri cards); Siri dialog stays speech-safe pounds
This commit is contained in:
@@ -102,14 +102,15 @@ struct CheapestFuelIntent: AppIntent {
|
||||
|
||||
let distanceKM = station.distanceKM(to: coordinate.lat, lng2: coordinate.lng)
|
||||
let distanceText = FuelStore.loadDistanceUnit().format(distanceKM)
|
||||
let priceText = String(format: "£%.3f", price / 100)
|
||||
let priceText = FuelStore.priceText(price)
|
||||
let priceSpoken = FuelStore.priceTextSpoken(price)
|
||||
let freshness = SiriCheapestLookup.freshnessLabel(
|
||||
updated: FuelStore.loadDataUpdated(),
|
||||
lastRefresh: FuelStore.loadLastRefresh()
|
||||
)
|
||||
let summary = "\(station.name): \(priceText), \(distanceText)"
|
||||
let freshnessClause = freshness.isEmpty ? "" : " — prices \(freshness)"
|
||||
let dialog = "The cheapest \(fuel.displayName.lowercased()) near you is \(station.name) at \(priceText), \(distanceText) away\(freshnessClause)."
|
||||
let dialog = "The cheapest \(fuel.displayName.lowercased()) near you is \(station.name) at \(priceSpoken), \(distanceText) away\(freshnessClause)."
|
||||
|
||||
return .result(
|
||||
value: summary,
|
||||
@@ -246,7 +247,8 @@ struct FavouriteFuelPriceIntent: AppIntent {
|
||||
)
|
||||
}
|
||||
|
||||
let priceText = String(format: "£%.3f", price / 100)
|
||||
let priceText = FuelStore.priceText(price)
|
||||
let priceSpoken = FuelStore.priceTextSpoken(price)
|
||||
let freshness = SiriCheapestLookup.freshnessLabel(
|
||||
updated: FuelStore.loadDataUpdated(),
|
||||
lastRefresh: FuelStore.loadLastRefresh()
|
||||
@@ -270,7 +272,7 @@ struct FavouriteFuelPriceIntent: AppIntent {
|
||||
summary = "\(favourite.station.name): \(priceText)"
|
||||
}
|
||||
|
||||
let dialog = "Your favourite \(fuelName) station, \(favourite.station.name), is at \(priceText)\(distanceClause)\(freshnessClause)."
|
||||
let dialog = "Your favourite \(fuelName) station, \(favourite.station.name), is at \(priceSpoken)\(distanceClause)\(freshnessClause)."
|
||||
|
||||
return .result(
|
||||
value: summary,
|
||||
|
||||
Reference in New Issue
Block a user