Skip to content

Use fractionDigits & significantDigits options in .convertTo(), allow Number values#101

Open
eemeli wants to merge 2 commits intomainfrom
simplify-conversion
Open

Use fractionDigits & significantDigits options in .convertTo(), allow Number values#101
eemeli wants to merge 2 commits intomainfrom
simplify-conversion

Conversation

@eemeli
Copy link
Copy Markdown
Member

@eemeli eemeli commented Apr 23, 2026

Following today's discussion on #90 (comment), this PR:

  • Updates the README to match the spec changes applied in Specify unit conversion for Amount.prototype.convertTo #89.
  • Replaces the .convertTo() precision options (minimum/maximum fraction/significant digits) with those of the constructor, i.e. fractionDigits and significantDigits, and updates their handling to correspond to what we're already doing in the constructor. roundingPriority is dropped, as specifying both fractionDigits and significantDigits is an error.
  • Changes it so that if you .convertTo() without any precision options, you end up with a Number-backed Amount.

CC @sffc, @gibson042

@eemeli eemeli requested review from ben-allen and jessealama April 23, 2026 17:41
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 23, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://tc39.github.io/proposal-amount/pr-preview/pr-101/

Built to branch gh-pages at 2026-04-23 22:51 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Comment thread README.md Outdated
Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants