Compare commits

..

No commits in common. "ba07d204c600bdbadc2b8db9449a6b6fc5b4c819" and "d48892751d2f59a616af81295e8bbfe115b3f4e3" have entirely different histories.

3 changed files with 6 additions and 6 deletions

View File

@ -4,4 +4,4 @@ Dead simple tip calculator that computes tip based on the subtotal, pre-tax. It'
## License
AGPLv3+, see LICENSE.md.
AGPL 3.0 only, see LICENSE.md.

View File

@ -4,12 +4,12 @@ plugins {
}
android {
namespace "quest.faraday.tip_calculator"
compileSdk 32
defaultConfig {
applicationId "quest.faraday.tip_calculator"
minSdk 21
targetSdk 33
compileSdk 33
targetSdk 32
versionCode 3
versionName "1.0.2"
@ -36,6 +36,7 @@ android {
}
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.7.0'

View File

@ -29,8 +29,7 @@ class MainActivity : AppCompatActivity() {
val tax = BigDecimal(binding.taxEdit.text.toString())
val gratuityCoeff = BigDecimal(binding.gratuityEdit.text.toString())
val tip = gratuityCoeff * subtotal
val saved = gratuityCoeff * (subtotal + tax) - tip
displayMessage("Tip: $${tip}\nTotal: $${subtotal+tax+tip}\nYou saved: $${saved}")
displayMessage("Tip: $${tip}\nTotal: $${subtotal+tax+tip}")
} catch (e: NumberFormatException) {
displayMessage("Invalid number format")
}