reversed some previous progress

This commit is contained in:
Isaac Greene 2022-05-25 22:27:05 -04:00
parent fb523742c6
commit 674979ebd3

View file

@ -69,8 +69,8 @@ struct PaceResults: View {
var body: some View { var body: some View {
let distanceDub = Double(distance) ?? 1.0 let distanceDub = Double(distance) ?? 1.0
var notSelectedSystem = "" //var notSelectedSystem = ""
var pacePerUnit = 0.0 //var pacePerUnit = 0.0
let convertedSeconds:Double = (Double(timeSeconds) ?? 0) * (1.666666666666666666666666) let convertedSeconds:Double = (Double(timeSeconds) ?? 0) * (1.666666666666666666666666)
let timeSecondsInt:Int = Int(timeSeconds) ?? 0 let timeSecondsInt:Int = Int(timeSeconds) ?? 0
@ -90,6 +90,8 @@ struct PaceResults: View {
let pace:Double = actualTime / distanceDub let pace:Double = actualTime / distanceDub
let paceString:String = String(format: "%.2f", pace) let paceString:String = String(format: "%.2f", pace)
/*
func pacePerOpString(selectedSystem: String, _ pacePerUnit: inout Double, actualTime: Double, distanceDub: Double, _ notSelectedSystem: inout String) -> String {
if selectedSystem == "km" { if selectedSystem == "km" {
pacePerUnit = actualTime / (distanceDub * 1.609344) pacePerUnit = actualTime / (distanceDub * 1.609344)
notSelectedSystem = "mi" notSelectedSystem = "mi"
@ -99,13 +101,16 @@ struct PaceResults: View {
notSelectedSystem = "km" notSelectedSystem = "km"
} }
let pacePerUnitString = String(format: "%.02f", pacePerUnit) let pacePerUnitString:String = String(format: "%.02f", pacePerUnit)
return pacePerUnitString
}
*/
VStack { VStack {
Text("Distance: \(distance)\(selectedSystem)") Text("Distance: \(distance)\(selectedSystem)")
Text("Total time: \(timeMinutesToHours):\(leadingZeros)") Text("Total time: \(timeMinutesToHours):\(leadingZeros)")
Text("\(paceString) minutes per \(selectedSystem)") Text("\(paceString) minutes per \(selectedSystem)")
Text("\(pacePerUnitString) minutes per \(notSelectedSystem)") //Text("\(pacePerOpString(selectedSystem: selectedSystem, &pacePerUnit, actualTime: actualTime, distanceDub: distanceDub, &notSelectedSystem)) minutes per \(notSelectedSystem)")
} }
} }
} }