Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix(forms): parse exponential notation in numberInputType parser #12122

Closed
wants to merge 1 commit into from

Conversation

caitp
Copy link
Contributor

@caitp caitp commented Jun 15, 2015

Closes #12121

@@ -13,7 +13,7 @@
var ISO_DATE_REGEXP = /\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/;
var URL_REGEXP = /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/;
var EMAIL_REGEXP = /^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i;
var NUMBER_REGEXP = /^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/;
var NUMBER_REGEXP = /^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE]\+?\d+)?\s*$/;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No negative exponents support?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah good point, amending

@lgalfaso
Copy link
Contributor

LGTM

@caitp
Copy link
Contributor Author

caitp commented Jun 15, 2015

thx

@caitp caitp closed this in ebd0fbb Jun 15, 2015
@Narretz
Copy link
Contributor

Narretz commented Jun 15, 2015

Does this fix #11602 too?

@gkalpak
Copy link
Member

gkalpak commented Jun 15, 2015

Trying the plnkr with snapshot confirms it does.

@Narretz
Copy link
Contributor

Narretz commented Jun 15, 2015

Thx @gkalpak

netman92 pushed a commit to netman92/angular.js that referenced this pull request Aug 8, 2015
Support parsing numbers in exponential notation, which Number.prototype.toString() returns
for sufficiently high numbers.

Closes angular#12121
Closes angular#12122
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants