tc39 / tc39/proposal-amount

November review

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

Nobody has claimed this yet.

Dominant language
HTML
Stars
58
Forks
12
Avg merge
2h 35m
Merged PRs (30d)
2

Description

Here's my review of the current version of the proposal:

  • Is there a reason to collect the total number of digits in StringIntlMV? It's not used anywhere and not actually useful due to leading zeros.
  • ApplyRoundingModeToPositive: Extra * on line 6
  • RoundAmountValueToFractionDigits: Use the ReverseRoundingMode helper function above?
  • RenderAmountValueWithFractionDigits:
    • numDigits should be fractionDigits
    • Line 8: remove the rounding code here. This function must never round. If it ever does, it's a spec bug and can generate incorrect results such as turning -0 into 0.
    • Line 9 is incorrect. As written, e will always be zero. I assume e should appear in the exponent, but then it will still always be zero because rounded is an integer. Picking the largest value here doesn't work either if, for example, v is 0.
    • Line 11 is incorrect. I can't tell what it's trying to do.
    • Line 13 is incorrect in a variety of ways. For example, n can never be positive on line e, but it can be negative.
  • get Decimal.prototype.significantDigits: No one sets [[SignificantDigits]]. This should call FractionToSignificantDigits instead.
  • ToIntlMathematicalValue: Spec type error on intlMV: it's a list but used as a scalar.

Contributor guide

Open the contributing guide

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

Review the proposal sections for StringIntlMV, ApplyRoundingModeToPositive, RoundAmountValueToFractionDigits, RenderAmountValueWithFractionDigits, Decimal.prototype.significantDigits, and ToIntlMathematicalValue. Check each named concern against the current proposal and its specification requirements. Done means the listed unused data, naming, rounding, exponent, sign, property, and type issues are resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.