ShareShortcuts

Calculate Tip & Split

idelaware
Dupliquer « Calculate Tip & Split »

Tu as créé quelque chose de nouveau à partir de ce raccourci ? Partage-le comme version dérivée : il devient un raccourci à toi, que tu gères, et les deux pages renvoient l’une vers l’autre pour que idelaware soit crédité.

  1. 1Obtenez le raccourci et modifiez-le dans l’app Raccourcis. Donnez-lui un nom bien à lui.
  2. 2Partage-le depuis l’app Raccourcis et copie le lien iCloud.
  3. 3Reviens ici, colle le lien et décris ce qui change, par exemple : « Ajout d’une étape qui utilise Apple Intelligence pour personnaliser le texte. »
Créer mon fork
Téléchargements
75K
Enregistré
1
Actions
58
Catégorie
Calculations
Version
5.0
Langue
EN

UPDATED WITH A FULL TIP TABLE: I can always figure out the tip in my head for myself, however the real reason and need for a calculator (for me) has always been when we have a group of people and everyone wants to be fair. Once you enter your bill amount, the calculator will do a regular calculation (if you want) and present you with options for 10%, 15%, 18%, and 20%, all rounded UP to the nearest dollar. (I did this because I believe that rounding down is rather rude.)

However, if you want to split the bill, you can run the shortcut, enter your total bill, enter the number of people who will be splitting the bill, and it will present you with the same percentage options, slightly rounded to the nearest few cents (as you can see from the final bill amounts of different cents on the dollar). This will allow you quick access to a full tip amount, split as fairly as possible.

Nouveautés

Version 5.0

Complete rewrite with tip tables and easy to view options.

Historique des versions
5.0 28 oct. 2018

Complete rewrite with tip tables and easy to view options.

4.0 26 oct. 2018

Final version (hopefully), fixed formatting for final message to the user.

3.0 22 oct. 2018

Streamlined final result by formatting numbers correctly.

2.0 22 oct. 2018

Fixed dialogue for tip splitting, indicating the $ amount of tip included in the split.

1.0 22 oct. 2018

First release

Ce qu’il fait

58 actions
  1. Ask for Input
    How much is the total bill?
  2. Format Number
  3. Number
  4. Calculate
  5. Round Number
  6. Calculate
  7. Format Number
  8. Number
  9. Calculate
  10. Round Number
  11. Calculate
  12. Format Number
  13. Number
  14. Calculate
  15. Round Number
  16. Calculate
  17. Format Number
  18. Number
  19. Calculate
  20. Round Number
  21. Calculate
  22. Format Number
  23. Choose from Menu
    Are you splitting this bill?
  24. Choose from Menu
    No
  25. Show Alert
    Here are suggested tips:
  26. Stop This Shortcut
  27. Choose from Menu
    Yes
  28. Ask for Input
    How many people will be splitting this bill?
  29. Get Variable
  30. Calculate
  31. Round Number
  32. Format Number
  33. Get Variable
  34. Calculate
  35. Format Number
  36. Get Variable
  37. Calculate
  38. Round Number
  39. Format Number
  40. Get Variable
  41. Calculate
  42. Format Number
  43. Get Variable
  44. Calculate
  45. Round Number
  46. Format Number
  47. Get Variable
  48. Calculate
  49. Format Number
  50. Get Variable
  51. Calculate
  52. Round Number
  53. Format Number
  54. Get Variable
  55. Calculate
  56. Format Number
  57. Show Alert
    Here are suggested tips:
  58. Stop This Shortcut

Afficher en tant que code
Bêta

Chaque action de ce raccourci écrite en Cherri, un langage de programmation pour Raccourcis. Idéal pour comprendre son fonctionnement.

#include 'actions/math'
#define color green
#define glyph dollarSign

const BillAmount = prompt("How much is the total bill?", "Number")
const FormattedBillAmount = formatNumber(0)
const Number = 0.1
const RoundedNumber10 = round(0)
const FormattedNumber10 = formatNumber(0)
const RoundedNumber15 = round(0)
const FormattedNumber15 = formatNumber(0)
const RoundedNumber18 = round(0)
const FormattedNumber18 = formatNumber(0)
const RoundedNumber20 = round(0)
const FormattedNumber20 = formatNumber(0)

menu "Are you splitting this bill?" {
item "No":
	alert("Your total bill is: ${FormattedBillAmount}\n(All tips are rounded up.)\n\nA 10% tip is: ${RoundedNumber10}\nYour new total is: ${FormattedNumber10}\n\nA 15% tip is: ${RoundedNumber15}\nYour new total is: {FormattedNumber15}\n\nAn 18% tip is: ${RoundedNumber18}\nYour new total is: ${FormattedNumber18}\n\nA 20% tip is: ${RoundedNumber20}\nYour new total is: ${FormattedNumber20}", "Here are suggested tips:")
	stop()
item "Yes":
	const AskForInputSplit = prompt("How many people will be splitting this bill?", "Number")
	// TODO: Get Variable not supported: Assign variable here to 'FormattedNumber10'.
	round(0)
	const FormattedNumberSplit10 = formatNumber(0, 2)
	// TODO: Get Variable not supported: Assign variable here to 'FormattedNumberSplit10'.
	const FormattedNumberSplit10V2 = formatNumber(0)
	// TODO: Get Variable not supported: Assign variable here to 'FormattedNumber15'.
	round(0)
	const FormattedNumberSplit15 = formatNumber(0)
	// TODO: Get Variable not supported: Assign variable here to 'FormattedNumberSplit15'.
	const FormattedNumberSplit15V2 = formatNumber(0)
	// TODO: Get Variable not supported: Assign variable here to 'FormattedNumber18'.
	round(0)
	const FormattedNumberSplit18 = formatNumber(0)
	// TODO: Get Variable not supported: Assign variable here to 'FormattedNumberSplit18'.
	const FormattedNumberSplit18V2 = formatNumber(0)
	// TODO: Get Variable not supported: Assign variable here to 'FormattedNumber20'.
	round(0)
	const FormattedNumberSplit20 = formatNumber(0)
	// TODO: Get Variable not supported: Assign variable here to 'FormattedNumberSplit20'.
	const FormattedNumberSplit20V2 = formatNumber(0)
}
alert("Your total bill is: ${FormattedBillAmount}\nYou will be splitting this bill {AskForInputSplit} ways.\n(All tips are rounded up.)\n\nA 10% tip is: ${RoundedNumber10}\nEach person pays: ${FormattedNumberSplit10}\nYour new total is: ${FormattedNumberSplit10V2}\n\nA 15% tip is: ${RoundedNumber15}\nEach person pays: ${FormattedNumberSplit15}\nYour new total is: ${FormattedNumberSplit15V2}\n\nAn 18% tip is: ${RoundedNumber18}\nEach person pays: ${FormattedNumberSplit18}\nYour new total is: ${FormattedNumberSplit18V2}\n\nA 20% tip is: ${RoundedNumber20}\nEach person pays: ${FormattedNumberSplit20}\nYour new total is: ${FormattedNumberSplit20V2}", "Here are suggested tips:")
stop()
Ouvrir dans Cherri Playground Décompilé avec cherri 2.3.0 (GPL-2.0). Quelques corrections peuvent être nécessaires avant la compilation.

Notes et avis

Écrire un avis
–
sur 5
★★★★★
★★★★
★★★
★★
★
0 ratings

Aucun avis pour le moment. Sois le premier à partager ton avis !

Publicité

Plus de idelaware

Tout afficher

Ça pourrait aussi te plaire

Tout afficher
Publicité