Math add api adds a `.0` on integer increments
Open
Nobody has claimed this yet.
bug
- Dominant language
- JavaScript
- Stars
- 2
- Forks
- 1
- Avg merge
- 8m
- Merged PRs (30d)
- 2
Description
When we use math add to increment an integer, a decimal point .0 is added, which is not expected.
Eg. Increment(0) will return 1.0 instead of 1 in db document.
// initial db entry: { totalDownloads: 273 }
await db.mathAdd(TABLE, documentId, {
totalDownloads: 1
});
// initial db entry: { totalDownloads: 274.0 }
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the JavaScript implementation and tests for mathAdd, then trace how an integer increment is represented before it is written to the database. Done means incrementing an integer such as totalDownloads by 1 stores 274 rather than 274.0, while preserving the behavior for other numeric values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100