MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / formatInput

Function formatInput

assets/js/phy_calc.js:64–74  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

62
63
64function formatInput(input) {
65 if (input.search("e") != -1) {
66 let index = input.search("e");
67 let x = input.substr(0, index);
68 let y = input.substr(index + 1,);
69 return Math.pow(parseFloat(x), parseFloat(y));
70 } else {
71 return parseFloat(input);
72 }
73
74}
75
76
77const quantites = document.getElementById('quantites');

Callers 1

CalculatorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected