Scientific notation
Numora expands values like 1.5e-7 to decimal notation. It usually enters the field through paste or through values your app passes in. A lone e typed at the end of the field is ignored, but an e typed between digits completes a token and expands too (1e5 becomes 100000). Expansion uses string arithmetic, so no floating-point precision is lost.
1.23 × 10⁻⁴Expanded to decimal notation
To refuse scientific notation instead, pass allowScientificNotation={false}. Numora then rejects a paste that holds a complete exponent, such as 1.5e-7, and an e typed between two digits. The field keeps the value it had. Values passed through value or defaultValue are expanded either way, because String(1e21) is "1e+21" in JavaScript.
Paste "1.5e-7", "2e+5" or "1.5e-17" to see each expanded
Both e and E work.
Limits
- The exponent can be at most 1000 in either direction.
1e1000expands to a1and 1000 zeros.1e1001and1e-1001are dropped, and the field ends up empty. - The exponent must be a whole number.
1e3.5is dropped. Anewith no digits after it is removed and the number stays:1ebecomes1. - Typing
1,e,5in that order gives15, because theeat the end of the field is ignored.