Skip to content

Commit 8e9e10a

Browse files
chore: Round base price to 2 decimal places in gold calculator
1 parent 4ae6906 commit 8e9e10a

File tree

5 files changed

+29
-31
lines changed

5 files changed

+29
-31
lines changed

calcualtors/gold_calculator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def calculate_price(self):
6767
dict: A dictionary with the base price, service charge, service charge percentage,
6868
tax, tax percentage, and final price.
6969
"""
70-
base_price = self.weight * self.price_per_gram
70+
base_price = round(self.weight * self.price_per_gram, 2)
7171
service_charge = self.calculate_service_charge(base_price)
7272
total_price = base_price + service_charge
7373
tax = self.calculate_tax(total_price)

templates/ext/navbar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<nav class="navbar navbar-expand-lg navbar-custom">
2-
<a class="navbar-brand" href="/">
2+
<a class="navbar-brand" href="{{ url_for('home') }}">
33
<i class="fas fa-home"></i>
44
Home</a>
55
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav">

templates/gold_calculator.html

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,21 @@
1111
<h1>Gold Price Calculator</h1>
1212
<p class="text-center">It's quick, easy, and accurate! with a clear and intuitive design.</p>
1313
<form action="/gold-calculator" method="POST" class="form-card shadow p-4 bg-white rounded">
14+
1415
<div class="form-group">
1516
<label for="weight">Weight (grams): <i class="fa-solid fa-scale-balanced"></i></label>
1617
<input type="number" step="0.01" name="weight" id="weight" class="form-control" placeholder="Enter weight in grams" required>
1718
</div>
19+
1820
<div class="form-group">
19-
<label>Gold Purity: <i class="fa-solid fa-magnifying-glass"></i></label>
20-
<div class="form-check">
21-
<input type="radio" name="purity" value="18k" id="18k" class="form-check-input">
22-
<label for="18k" class="form-check-label">18k</label>
23-
</div>
24-
<div class="form-check">
25-
<input type="radio" name="purity" value="22k" id="22k" class="form-check-input" checked>
26-
<label for="22k" class="form-check-label">22k</label>
27-
</div>
28-
<div class="form-check">
29-
<input type="radio" name="purity" value="24k" id="24k" class="form-check-input">
30-
<label for="24k" class="form-check-label">24k</label>
31-
</div>
32-
</div>
21+
<label for="purity">Gold Purity: <i class="fa-solid fa-magnifying-glass"></i></label>
22+
<select name="purity" id="purity" class="form-control" required>
23+
<option value="18k">18k</option>
24+
<option value="22k" selected>22k</option>
25+
<option value="24k">24k</option>
26+
</select>
27+
</div>
28+
3329
<div class="form-group">
3430
<label for="price_per_gram">Price per gram (INR): <i class="fa-solid fa-weight-hanging"></i></label>
3531
<input type="number" step="0.01" name="price_per_gram" id="price_per_gram" class="form-control" placeholder="Enter price per gram" value="{{ price_per_gram }}" required>
@@ -39,10 +35,12 @@ <h1>Gold Price Calculator</h1>
3935
<label for="service_charge">Service Charge (%): <i class="fa-solid fa-file-invoice-dollar"></i></label>
4036
<input type="number" step="0.01" name="service_charge" id="service_charge" class="form-control" placeholder="Enter service charge percentage" value="{{ service_charge }}" required>
4137
</div>
38+
4239
<div class="form-group">
4340
<label for="tax">Tax (%): <i class="fa-solid fa-file-invoice-dollar"></i></label>
4441
<input type="number" step="0.01" name="tax" id="tax" class="form-control" placeholder="Enter tax percentage" value="{{ tax }}" required>
4542
</div>
43+
4644
<button type="submit" class="btn btn-hero btn-block mt-4">Generate Estimate Bill</button>
4745
</form>
4846
</div>

templates/homepage.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% extends 'base/base.html' %}
2-
{% block title %} Home {% endblock %}
2+
{% block title %} Gold/Silver Calculator | HomePage {% endblock %}
33
{% block styles %}
44
<link rel="stylesheet" href="{{ url_for('static', filename='css/homepage.css') }}">
55
{% endblock %}

templates/pricing.html

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66
{% block content %}
77
<div class="container">
88
<h1>Pricing Plans</h1>
9+
910
<div class="card">
1011
<div class="card-header">
1112
<h2>Basic Plan</h2>
1213
</div>
1314
<div class="card-body">
14-
<h3>5000</h3>
15+
<h3>4,999</h3>
1516
<p>Includes basic features for a single user.</p>
1617
<ul>
1718
<li>Basic calculations</li>
1819
<li>Standard support</li>
1920
</ul>
20-
<a href="mailto:[email protected]" class="btn btn-custom">Contact Us</a>
2121
</div>
2222
</div>
2323

@@ -26,31 +26,31 @@ <h3>₹5000</h3>
2626
<h2>Pro Plan</h2>
2727
</div>
2828
<div class="card-body">
29-
<h3>10000</h3>
29+
<h3>7,999</h3>
3030
<p>Includes advanced features and priority support.</p>
3131
<ul>
3232
<li>Advanced calculations</li>
3333
<li>Priority support</li>
3434
<li>Additional customization options</li>
3535
</ul>
36-
<a href="mailto:[email protected]" class="btn btn-custom">Contact Us</a>
3736
</div>
3837
</div>
3938

40-
<!-- <div class="card">
39+
<!-- Contact Card -->
40+
<div class="card contact-card">
4141
<div class="card-header">
42-
<h2>Enterprise Plan</h2>
42+
<h2>Contact Information</h2>
4343
</div>
4444
<div class="card-body">
45-
<h3>₹20000</h3>
46-
<p>Custom solution tailored for large organizations.</p>
45+
<h3>Get in Touch</h3>
46+
<p>If you have any questions or need further assistance, feel free to reach out to us!</p>
4747
<ul>
48-
<li>Custom features</li>
49-
<li>Dedicated support</li>
50-
<li>Full customization and integration</li>
48+
<li><strong>Email:</strong> [email protected]</li>
49+
<li><strong>Phone:</strong> +91 9818183049</li>
5150
</ul>
52-
<a href="#" class="btn btn-custom">Contact Us</a>
51+
<a href="mailto:[email protected]" class="btn btn-custom">Email Us</a>
5352
</div>
54-
</div> -->
53+
</div>
54+
5555
</div>
56-
{% endblock %}
56+
{% endblock %}

0 commit comments

Comments
 (0)