Move detail approximation after verdict amount

This commit is contained in:
FuelBoard Contributor
2026-10-17 20:24:21 +01:00
parent c6e252d194
commit 7aa2485994
4 changed files with 44 additions and 2 deletions
+20
View File
@@ -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.