Skip to content

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

<NumoraInput />

Both e and E work.

Limits

  • The exponent can be at most 1000 in either direction. 1e1000 expands to a 1 and 1000 zeros. 1e1001 and 1e-1001 are dropped, and the field ends up empty.
  • The exponent must be a whole number. 1e3.5 is dropped. An e with no digits after it is removed and the number stays: 1e becomes 1.
  • Typing 1, e, 5 in that order gives 15, because the e at the end of the field is ignored.