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

exponential notation in input[type=number] validation #12121

Closed
mprokopowicz opened this issue Jun 15, 2015 · 1 comment
Closed

exponential notation in input[type=number] validation #12121

mprokopowicz opened this issue Jun 15, 2015 · 1 comment

Comments

@mprokopowicz
Copy link

If we provide some long number, like 111111111111111111111111 in the input[type=number] and then click this little up/down arrow, then input value is converted to exponential notation: 1.11111111111111111e+23

Angular consider this is invalid value, but i think it should be still valid:

> typeof 1.11111111111111111e+23
< "number"

See this plunker:
http://embed.plnkr.co/hBmk7d/preview

@caitp
Copy link
Contributor

caitp commented Jun 15, 2015

Yeah, the number regexp doesn't deal with exponential notation currently. It shouldn't be a difficult PR to submit if interested

caitp added a commit to caitp/angular.js that referenced this issue Jun 15, 2015
caitp added a commit to caitp/angular.js that referenced this issue Jun 15, 2015
caitp added a commit to caitp/angular.js that referenced this issue Jun 15, 2015
@caitp caitp closed this as completed in ebd0fbb Jun 15, 2015
netman92 pushed a commit to netman92/angular.js that referenced this issue 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
None yet
Projects
None yet
Development

No branches or pull requests

2 participants