Skip to content

Commit 9c859be

Browse files
committed
[UI] Serialize NaN and null as n/a
1 parent f1ae6d4 commit 9c859be

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sensorhub-webui-core/src/main/java/org/sensorhub/ui/SWECommonForm.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,12 @@ protected String getCaption(DataComponent dataComponent, boolean showValues)
168168

169169
if (showValues && dataComponent.hasData())
170170
{
171+
var str = sweUtils.getStringValue((DataValue)dataComponent);
172+
if ("NaN".equals(str) || "null".equals(str))
173+
str = "n/a";
174+
171175
caption.append(" = ");
172-
caption.append(sweUtils.getStringValue((DataValue)dataComponent));
176+
caption.append(str);
173177
caption.append(' ');
174178
if (uom != null)
175179
caption.append(uom);

0 commit comments

Comments
 (0)