@toolsnap/tip-calculator
v1.0.0
Published
Lightweight tip calculation utility functions for restaurant bills and service tips
Maintainers
Readme
@toolsnap/tip-calculator
Lightweight tip calculation utility for restaurant bills and service tips.
Installation
npm install @toolsnap/tip-calculatorUsage
const { calculateTip, suggestTips, tipEtiquette } = require('@toolsnap/tip-calculator');
// Basic tip calculation
const result = calculateTip(85.50, 18, 2);
// { tip: 15.39, total: 100.89, perPerson: 50.45 }
// Get suggestions at common percentages
suggestTips(85.50);
// [ { percent: 10, tip: 8.55, total: 94.05 }, ... ]
// Check etiquette guidelines
tipEtiquette(18, 'us');
// { min: 15, max: 25, isInRange: true }API
calculateTip(billAmount, tipPercent, numberOfPeople?)— Calculate tip, total, and per-person splitsuggestTips(billAmount)— Returns tip suggestions at 10%, 15%, 18%, 20%, 25%tipEtiquette(tipPercent, region?)— Check if tip falls within cultural guidelines
Links
- 🏠 ToolSnap - Free Online Tip Calculator
- 📦 More tools at risetop.top
License
MIT
