Skip to content

robpecoraro/tipCalculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Basic App: The Tip calculator

I expanded on another simple app that just added two values from text boxes. I used this app to practice formating doubles to the standard 2 decimal places. To do this in swift, do the following:

  1. Multiply your value by 100 (for the 2nd place unit)
  2. Round that value.
  3. Divide the roudned value by 100.
  4. Profit.

Example:

Double((round(12.12432 * 100) / 100))

The app returns the individual fields for sales tax, tip and total meal cost as individual labels. This was a nicer improvement than my one label for everything.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages