title: How do you take User Input in a text box and use it to perform math in Kotlin?
body: <p>I'm building an android app that calculates commission for employees. I can't figure out how to call the user input and use it to perform the math. What I'd like to happen is they input all the numbers in each field, then click on the calculate button. That should call the first input field and multiply it by 5, then the second input field and multiply by 7.5 etc until all six user input fields have been multiplied by a set number, then it should add them all together and dump them into the &quot;Payout&quot; field. I just cant seem to find a place to start. If anyone could put me on the right path, I'd appreciate it. Code snippets below for a bit of extra context.</p>
  <pre><code>    &lt;Button
      android:id=&quot;@+id/button&quot;
      android:layout_width=&quot;207dp&quot;
      android:layout_height=&quot;0dp&quot;
      android:layout_marginBottom=&quot;17dp&quot;
      android:text=&quot;@string/calculate&quot;
      app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
      app:layout_constraintEnd_toEndOf=&quot;parent&quot;
      app:layout_constraintStart_toStartOf=&quot;parent&quot;
      app:layout_constraintTop_toBottomOf=&quot;@+id/editTextNumber7&quot; /&gt;
  
  &lt;EditText
      android:id=&quot;@+id/editTextNumber7&quot;
      android:layout_width=&quot;wrap_content&quot;
      android:layout_height=&quot;wrap_content&quot;
      android:layout_marginBottom=&quot;5dp&quot;
      android:ems=&quot;10&quot;
      android:hint=&quot;@string/payout&quot;
      android:importantForAutofill=&quot;no&quot;
      android:inputType=&quot;number&quot;
      app:layout_constraintBottom_toTopOf=&quot;@+id/button&quot;
      app:layout_constraintEnd_toEndOf=&quot;parent&quot;
      app:layout_constraintStart_toStartOf=&quot;parent&quot;
      app:layout_constraintTop_toBottomOf=&quot;@+id/editTextNumber4&quot; /&gt;
  </code></pre>