reversed some previous progress
This commit is contained in:
parent
fb523742c6
commit
674979ebd3
1 changed files with 17 additions and 12 deletions
|
|
@ -69,8 +69,8 @@ struct PaceResults: View {
|
|||
var body: some View {
|
||||
let distanceDub = Double(distance) ?? 1.0
|
||||
|
||||
var notSelectedSystem = ""
|
||||
var pacePerUnit = 0.0
|
||||
//var notSelectedSystem = ""
|
||||
//var pacePerUnit = 0.0
|
||||
|
||||
let convertedSeconds:Double = (Double(timeSeconds) ?? 0) * (1.666666666666666666666666)
|
||||
let timeSecondsInt:Int = Int(timeSeconds) ?? 0
|
||||
|
|
@ -90,22 +90,27 @@ struct PaceResults: View {
|
|||
let pace:Double = actualTime / distanceDub
|
||||
let paceString:String = String(format: "%.2f", pace)
|
||||
|
||||
if selectedSystem == "km" {
|
||||
pacePerUnit = actualTime / (distanceDub * 1.609344)
|
||||
notSelectedSystem = "mi"
|
||||
}
|
||||
else {
|
||||
pacePerUnit = actualTime / (distanceDub * 0.6213711922)
|
||||
notSelectedSystem = "km"
|
||||
}
|
||||
/*
|
||||
func pacePerOpString(selectedSystem: String, _ pacePerUnit: inout Double, actualTime: Double, distanceDub: Double, _ notSelectedSystem: inout String) -> String {
|
||||
if selectedSystem == "km" {
|
||||
pacePerUnit = actualTime / (distanceDub * 1.609344)
|
||||
notSelectedSystem = "mi"
|
||||
}
|
||||
else {
|
||||
pacePerUnit = actualTime / (distanceDub * 0.6213711922)
|
||||
notSelectedSystem = "km"
|
||||
}
|
||||
|
||||
let pacePerUnitString = String(format: "%.02f", pacePerUnit)
|
||||
let pacePerUnitString:String = String(format: "%.02f", pacePerUnit)
|
||||
return pacePerUnitString
|
||||
}
|
||||
*/
|
||||
|
||||
VStack {
|
||||
Text("Distance: \(distance)\(selectedSystem)")
|
||||
Text("Total time: \(timeMinutesToHours):\(leadingZeros)")
|
||||
Text("\(paceString) minutes per \(selectedSystem)")
|
||||
Text("\(pacePerUnitString) minutes per \(notSelectedSystem)")
|
||||
//Text("\(pacePerOpString(selectedSystem: selectedSystem, &pacePerUnit, actualTime: actualTime, distanceDub: distanceDub, ¬SelectedSystem)) minutes per \(notSelectedSystem)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue