function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
VenkataRamanjaneyulu KattamuruVenkataRamanjaneyulu Kattamuru 

Bug? Lightning Input tag when type= "Number" is accepting only one character called "e"

Hi,

Just  now , I saw that lightning input tag is accepting a character called "e" evenhough type is a number.
May be there is a bug in this component.
 
<lightning:input type="number" name="number" label="Number" />

Thanks&Regards,
Venkat Kattamuru.
 
Khan AnasKhan Anas (Salesforce Developers) 
Hi Venkata,

Greetings to you!

1e1 is a valid number, that's an exponential notation: https://en.wikipedia.org/wiki/Scientific_notation#E_notation
The number input can accept floating-point numbers, including negative symbols and the 'e' or 'E' character.

Please refer to the below links which might help you further.

https://stackoverflow.com/questions/31706611/why-does-the-html-input-with-type-number-allow-the-letter-e-to-be-entered-in/31706796#31706796

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
VenkataRamanjaneyulu KattamuruVenkataRamanjaneyulu Kattamuru
Hi Khan Ans,

Thank you for your response.

As per your answer ,it have to accept 20e but it was throwing an error as shown below.

issue

Thanks&Regards,
Venkat.
VenkataRamanjaneyulu KattamuruVenkataRamanjaneyulu Kattamuru
if i am giving 20e1 it is fine, but by default e means e power 1 right ?