Skip to content

Commit

Permalink
Update WaterCalculatorView.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
pedromos16 authored May 10, 2023
1 parent c073556 commit 71dc131
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions SwifUI/Calculadoras/WaterCalculatorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
import SwiftUI

struct WaterCalculatorView: View {

//variaveis

@State private var weight = ""
@State private var waterIntakeString = "0"

Expand Down Expand Up @@ -66,6 +69,8 @@ struct WaterCalculatorView: View {
}
}

//calculadora em si

private func calculateWaterIntake() -> String {
if let weight = Float(weight.replacingOccurrences(of: ",", with: ".")) {
let waterIntake = weight * 35 / 1000 // conversão para litros
Expand Down

0 comments on commit 71dc131

Please sign in to comment.