Skip to content

Commit

Permalink
Fix decimal points + remove unwanted decimals in amount
Browse files Browse the repository at this point in the history
  • Loading branch information
gokulkrishh committed Aug 11, 2023
1 parent 54ad8a7 commit eddd729
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions components/add/expenses.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ export default function AddExpense({ show, onHide, mutate, selected, lookup }: A
placeholder="199"
required
min="0"
step="any"
onChange={(event) => setState({ ...state, price: event.target.value })}
value={state.price}
/>
Expand Down
3 changes: 2 additions & 1 deletion components/add/income.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,10 @@ export default function AddIncome({ show, onHide, mutate, selected, lookup }: Ad
className="mt-1.5"
id="amount"
type="number"
placeholder="100000"
placeholder="10000"
required
min="0"
step="any"
onChange={(event) => setState({ ...state, price: event.target.value })}
value={state.price}
/>
Expand Down
4 changes: 3 additions & 1 deletion components/add/investments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ export default function AddInvestments({ show, onHide, mutate, selected, lookup
className="mt-1.5"
id="price"
type="number"
placeholder="10000"
placeholder="1000"
required
step="any"
min="0"
onChange={(event) => setState({ ...state, price: event.target.value })}
value={state.price}
Expand All @@ -156,6 +157,7 @@ export default function AddInvestments({ show, onHide, mutate, selected, lookup
placeholder="10"
required
min="0"
step="any"
onChange={(event) => setState({ ...state, units: event.target.value })}
value={state.units}
/>
Expand Down
3 changes: 2 additions & 1 deletion components/add/subscriptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,10 @@ export default function AddSubscriptions({ show, onHide, mutate, selected, looku
className="mt-1.5"
id="price"
type="number"
placeholder="199"
placeholder="699"
required
min="0"
step="any"
onChange={(event) => setState({ ...state, price: event.target.value })}
value={state.price}
/>
Expand Down
2 changes: 1 addition & 1 deletion lib/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const defaultCurrency = 'INR';
const defaultLocale = 'en-IN';
const defaultDateStyle = { day: '2-digit', month: 'short', year: 'numeric' };
const timeStyle = { hour: 'numeric', minute: 'numeric' };
const currencyStyle = { style: 'currency', currency: '', minimumFractionDigits: 2, maximumFractionDigits: 2 };
const currencyStyle = { style: 'currency', currency: '', minimumFractionDigits: 0, maximumFractionDigits: 2 };

type Currency = {
value: number | bigint;
Expand Down

1 comment on commit eddd729

@vercel
Copy link

@vercel vercel bot commented on eddd729 Aug 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.