AngularJS struggles to process large numbers when presented in scientific notation

I am encountering an issue with large numbers retrieved from a web service and displayed in an <input type="number"> field. Everything works fine until Angular converts the values to scientific notation. The value is displayed correctly initially, but if the user tries to modify it, the value gets silently deleted.

Below is an example code snippet:

<div ng-app="testApp" ng-controller="testController">
    <input ng-model="value1" type="number" />{{ value1 }}
</div>

var app = angular.module("testApp", []);
app.controller('testController', function ($scope) {
  $scope.value = 1e+100;
});

http://jsfiddle.net/SJVH7/10/ (try modifying the first input box to 1e+101)

What is the best way to handle such large numbers in this scenario?

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Waiting for the execution of the loop to be completed before proceeding - Typescript (Angular)

There's a code snippet triggered on an HTML page when clicked: public salaryConfirmation() { const matDialogConfig: MatDialogConfig = _.cloneDeep(GajiIdSettings.DIALOG_CONFIG); this.warningNameList = []; for(let i=0; i < this.kelolaDat ...

Attempting to grasp the correct method for understanding For loops

Lately, I've been diving into teaching myself Node.JS and it has been quite an enjoyable experience. However, I've hit a frustrating roadblock that is really causing me some grief. For some reason, I just can't seem to grasp the concept of F ...

Guide to transferring the current date to a text box using Angular JS with Protractor

I need to add a date field that is in text type. The HTML code for it is as follows: <input class="form-control ng-pristine ng-invalid ng-touched" type="text" id="date" name="date"> Can anyone assist me in automatically sending the current date to ...

Value preselected in the dropdown menu

I need to display the 'Choose option' as a disabled option in a drop down list that is generated from another page. page1.php <div class="col-md-4"> <select class="form-control" name="task" id="task" required> ...

Can you explain how to retrieve the selector from the objects $(document) and $(window)?

Can anyone help me understand how to retrieve the selector from $(document) and $(window)? el = $(document); alert(el.selector); // When I run this, it returns nothing. How can I output -> document? el = $(window); alert(el.selector); // Again, this ...

Loop through the array of objects using ng-repeat and generate input forms

[{"id":1,"inputfieldbox":[{"id":1},{"id":2}]},{"id":2,"inputfieldbox":{"id":1}}] I plan to implement NG-repeat for form iteration. The inputfield box represents the amount of input boxes I will include, while id indicates the number of field groups requi ...

Adjust the minimum and maximum values of the Y-axis based on the scale of the X-axis

Currently, I am faced with the challenge of adjusting the Y-axis to scale with changes in X-scale. I have a long unixtime value Array for initializing a flot chart, along with buttons to modify the scale. However, I am struggling to synchronize the Y-axis ...

Antd Select functionality experiencing issues on mobile devices

I've been working with antd on a new project and everything seems to be running smoothly on both web and mobile platforms, except for the antd select component. It's giving me some trouble on mobile. Any suggestions on how to fix this issue? < ...

Accessing JSON data from the Public folder in a create-react-app

I have a JSON file called ipAddress.json with the following content: { "ipAddress": "11.111.111.111" } To access this file, I placed it in an "ipAddress" folder within the public directory. So now the path is "public/ipAddress/ipAddress.json". However, ...

Issue with validating alphanumeric value with multiple regex patterns that allow special characters

I have created a regular expression to validate input names that must start with an alphanumeric character and allow certain special characters. However, it seems to be accepting invalid input such as "sample#@#@invalid" even though I am only allowing sp ...

Retrieving Dropdown Value in Bootstrap 5: How to Obtain the Selected Item's Value from the Dropdown Button

I am having a slight issue with my dropdown button where I am trying to display the selected item as the value of the dropdown button. The Flag Icon and Text should be changing dynamically. I have tried some examples but it seems that it is not working as ...

Referencing a JSON object

Here is a JSON list of search terms: [ "halo", [ "halo reach", "halo anniversary", "halo 4", "halo 3", "halo mega bloks", "halo 2", "halo sleepsack", "halo wars", "halo reach xbox 360", "halo combat evolved" ], ...

MS Edge modifies the attribute's empty value to 1

I have written a JavaScript code to extract values from a list, but in the Windows Edge browser, it returns a value of 1 even when the actual value of the <li> tag is blank. For example: HTML Code <ul> <li value="">Test 1</li&g ...

Angular: Truncating text based on element width - A guide

I am working on displaying a String text and determining how many words to hide based on the screen width. Here is my current approach: app.filter('words', function () { return function (input, words) { if (isNaN(words)) re ...

Is there a way to automatically close the InAppBrowser once certain content is displayed?

Is there a way to automatically close the $cordovaInAppBrowser when it loads my website and retrieves the content "OK"? My goal is to hide the close button in the browser window. Any suggestions on how to accomplish this? ...

Continue to verify that it is still in progress

Need help with delete button functionality: <a onclick="return confirm('are you sure?')" class="btn btn-default btn-sm deleteList" href="#" list_id="1467" title="Delete your list: listName">Delete</a> Any ideas on why cancel doesn&a ...

Trouble with jQuery event.keyCode in detecting alphanumeric characters

I recently developed a script that is supposed to detect the key the user clicks and perform an action based on whether it is alphanumeric. However, I am encountering an issue as the script does not seem to be working as expected, and I am not receiving an ...

Blur event triggers on V-autocomplete without a value

How can I retrieve the selected values from a v-autocomplete upon blur event? Currently, the value $event.target.value always returns an empty string. As a workaround, I have been using the following code to split the parentElement's innerText: var va ...

"How to change the hover background of a select element in Chrome from its default setting to something else

https://i.sstatic.net/G2deM.png Is there a way to remove the background color on hover and replace it with a different color? .drp-policydetails { border: 1px solid #dddddd; background-color: #ffffff; } <div className="form-group"> <sele ...

display the hidden box contents when clicking the button within a PHP loop

I am attempting to create a simple e-commerce site for learning purposes, but I encountered an issue when trying to display information upon clicking a button. The button does not seem to trigger any action as expected. It is meant to reveal text from the ...