mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-21 20:55:48 +00:00
JS: Fix amount parsing to accept negative exponents.
This commit is contained in:
committed by
Stefan Thomas
parent
2baccc4800
commit
81882bd1fa
@@ -1025,7 +1025,7 @@ Amount.prototype.parse_value = function (j) {
|
|||||||
else if ('string' === typeof j) {
|
else if ('string' === typeof j) {
|
||||||
var i = j.match(/^(-?)(\d+)$/);
|
var i = j.match(/^(-?)(\d+)$/);
|
||||||
var d = !i && j.match(/^(-?)(\d+)\.(\d*)$/);
|
var d = !i && j.match(/^(-?)(\d+)\.(\d*)$/);
|
||||||
var e = !e && j.match(/^(-?)(\d+)e(\d+)$/);
|
var e = !e && j.match(/^(-?)(\d+)e(-?\d+)$/);
|
||||||
|
|
||||||
if (e) {
|
if (e) {
|
||||||
// e notation
|
// e notation
|
||||||
|
|||||||
Reference in New Issue
Block a user