SwiftUI Watch convert input

Hi Team,

I am building and playing around with a simple Watch App using SwiftUI.

Looks like I have to use TextField as an input, it’s then a String.

The user then adds a value as a number int or double, but as it’s a textfield it is a String.

I need to work out a way to take the two inputs and make a calculation.

See code below…

I wish to take the litresValue String and change it to a double being litresValueNumber Double and then make a calculation with the other input mixRatioValue and change it to a double.

Any suggestions ?

Cheers. Help !

Code below.

// ContentView.swift
// FuelMix iWatch WatchKit Extension
// Created by Craig Karen Shine on 29/12/19.
// Copyright © 2019 Craig Karen Shine. All rights reserved.

import SwiftUI

struct ContentView: View {
@State private var litresValue: String = “1”
@State private var mixRatioValue: String = “50”
@State private var litreValueNumber: Double = 0.0
@State private var mixRatioValueNumber: Double = 0.0

var body: some View {

  VStack {
      .frame(width: 60.0, height: 60.0)
      .padding(.top, -11.0)
    HStack {
      TextField("", text: $litresValue)
    HStack {
      Text("Mix\rRatio:1 ")
      TextField("", text: $mixRatioValue)
    NavigationLink(destination: DisplayValue()) {



struct ContentView_Previews: PreviewProvider {
static var previews: some View {