Move detail approximation after verdict amount
This commit is contained in:
@@ -236,6 +236,26 @@ extension FuelSavingsResult {
|
||||
headline().replacingOccurrences(of: "Approx. ", with: "Approximately ")
|
||||
}
|
||||
|
||||
/// Full monetary verdict used by Station Details. Estimated confidence is a
|
||||
/// trailing qualifier so the amount remains the first figure users scan.
|
||||
func detailCapsuleHeadline() -> String {
|
||||
let qualifier = journeyConfidence.isEstimated ? " (approx.)" : ""
|
||||
switch status {
|
||||
case .baseline:
|
||||
return Self.baselineHeadline
|
||||
case .breakEven:
|
||||
return "\(Self.breakEvenHeadline)\(qualifier)"
|
||||
case .worthTheDrive:
|
||||
return "Save \(FuelSavingsFormat.money(netSavingGBP))\(qualifier)"
|
||||
case .notWorthTheDrive:
|
||||
return "Costs \(FuelSavingsFormat.money(abs(netSavingGBP))) more\(qualifier)"
|
||||
}
|
||||
}
|
||||
|
||||
func detailCapsuleSpokenHeadline() -> String {
|
||||
detailCapsuleHeadline().replacingOccurrences(of: "(approx.)", with: "(approximately)")
|
||||
}
|
||||
|
||||
/// Row capsule copy. The baseline relationship is shown as secondary text
|
||||
/// beside the capsule in the station listing and detail summary, so the
|
||||
/// capsule itself contains only the verdict.
|
||||
|
||||
Reference in New Issue
Block a user