Accept prices of the form n.nnne[+-]nn, i.e. with an exponent.

An example requiring this is currency conversion from IDR to USD.
This commit is contained in:
Mike Alexander
2014-11-23 23:28:26 -05:00
parent d9900a7b4f
commit 80d65c8efc

View File

@@ -187,7 +187,7 @@ sub schemify_num {
if(!$numstr) { return "failed-conversion"; }
if($numstr =~ /^\s*(\d+(\.\d+)?)$/o) {
if($numstr =~ /^\s*(\d+(\.\d+)?([eE][+-]?\d+)?)$/o) {
return $1;
} else {
return "failed-conversion";