Skip to content

Commit

Permalink
fix single character units
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Herwege <[email protected]>
  • Loading branch information
mherwege committed May 25, 2023
1 parent b9f03eb commit 9653d2d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ private String parseNumber(String value) {
if (COMMA_SEPARATOR_PATTERN.matcher(newValue).find()) {
newValue = newValue.replace("/\\./g", "").replace(",", ".");
}
if (unitValue.length() > 1) {
if (unitValue.length() > 0) {
newValue = newValue + " " + unitValue;
}
return newValue;
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.ui.basic/web-src/smarthome.js
Original file line number Diff line number Diff line change
Expand Up @@ -1589,7 +1589,7 @@
if (commaSeparatorPattern.test(newValue)) {
newValue = newValue.replace(/\./g, "").replace(",", ".");
}
if (unitValue.length > 1) {
if (unitValue.length > 0) {
newValue = newValue + " " + unitValue;
} else if (unit !== undefined) {
newValue = newValue + " " + unit;
Expand Down

0 comments on commit 9653d2d

Please sign in to comment.