[BasicUI] Revert uppercasing exponent (#2698)
Core now accepts lowercased exponent since https://github.com/openhab/openhab-core/pull/3834 @mherwege would you mind verifying this please? Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>pull/2699/head
parent
19a1acf320
commit
4dc1bda5c1
|
@ -2348,15 +2348,13 @@
|
|||
}
|
||||
}
|
||||
|
||||
function parseNumber(value, unit, keepExponentChar) {
|
||||
function parseNumber(value, unit) {
|
||||
var newValue = value.trim();
|
||||
var numberMatch = newValue.match(numberPattern);
|
||||
if (numberMatch && (numberMatch.length > 0)) {
|
||||
var numberValue = numberMatch[0];
|
||||
var unitValue = newValue.substring(numberValue.length).trim();
|
||||
newValue = numberValue.replace(/^\+/, "");
|
||||
// when sending updates, only uppercase E for exponent is accepted, don't change when only parsing for visualisation
|
||||
newValue = keepExponentChar ? newValue : newValue.replace("e", "E");
|
||||
if (commaSeparatorPattern.test(newValue)) {
|
||||
newValue = newValue.replace(/\./g, "").replace(",", ".");
|
||||
}
|
||||
|
@ -2461,7 +2459,7 @@
|
|||
|
||||
if (_t.inputHint === "number") {
|
||||
if (newValue !== "") {
|
||||
newValue = parseNumber(newValue, _t.unit, true).value;
|
||||
newValue = parseNumber(newValue, _t.unit).value;
|
||||
var valueArray = newValue.trim().split(" ");
|
||||
newValue = valueArray[0];
|
||||
if (valueArray.length > 1) {
|
||||
|
|
Loading…
Reference in New Issue