MichaelBluetooth / MichaelBluetooth/ic-reuse-client

Homework: Make sure "price" field only accepts 2 decimal places

Open
#7 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

difficulty-2 homework
Dominant language
TypeScript
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

The "add listing" page should not allow users to enter more than 2 decimal places.

NOTES:

  • We've got some examples in code of adding validators to form controls. We've really only used out-of-the-box validators, such as Validators.required. Angular lets you define your own custom validators. One way to solve this problem would be to create a custom validator that ensures the given number is at most 2 decimal places.
  • This issue pairs nicely with #4

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the add listing page and inspect the existing form-control validator examples, then consult Angular's custom-validator form-validation guidance linked in the issue. The work is done when the price control rejects values with more than two decimal places while retaining the existing validation behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.