-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Range with NaN, Infinity #12
Comments
I agree that throwing a |
I agree with the NaN should throw RangeError, but I disagree with Infinity.
looks reasonable to me. Why should we prohibit that? |
My reasoning was that we might eventually want something like "5+" or "≥5" for formatRange(5,Infinity), but ICU doesn't support that yet. But, if we adopted the current behavior, we could add these other styles via an option. |
2020-10-08: Throw on NaN; allow Infinity and -Infinity. |
I think we should probably forbid NaN and Infinity from taking part in a number range format. What would be your expected behavior in these cases?
The first case makes no sense. The second case could be an interesting application of the "greater than" pattern, but that's not yet supported in ICU.
For now, better to throw a RangeError. We can remove that restriction later if we ever needed to.
The text was updated successfully, but these errors were encountered: