I don't think there's a way to "format" an integer field to show commas. So the only way to do this is to have a label (or a string parameter) that updates when the integer changes. That label mirrors what is in the integer parameter, but has a comma inserted.
Roger's answer above shows how to do this. I found a similar answer here:
https://stackoverflow.com/questions/2901102/how-to-print-a-number-with-commas-as-thousands-separators-in-javascript
With that, I created a quick panel that shows how this would work:
<abs contexttype="opengear" gridsize="20" id="_top" keepalive="false" style="">
<meta>
<params>
<param access="1" constrainttype="INT_NULL" name="number" oid="number" precision="0" type="INT16" value="10010" widget="default"/>
</params>
<context contexttype="opengear" id="Graphite.1" objectid="opengear.devicefiles.misc<br>Slot 1<br>Graphite" objecttype="Graphite"/>
</meta>
<param expand="true" height="20" left="80" oid="number" showlabel="false" top="40" width="180">
<task tasktype="ogscript">function numberWithCommas(x) {
x = x.toString();
var pattern = /(-?\d+)(\d{3})/;
while (pattern.test(x))
x = x.replace(pattern, "$1,$2");
return x;
}
var valueWithoutComma = params.getValue("number",0);
var valueWithComma = numberWithCommas(valueWithoutComma);
ogscript.rename("number_label", valueWithComma);</task>
</param>
<label height="20" id="number_label" left="280" style="txt-align:west" top="40" width="220"/>
</abs>
The limitation on this is that the label (or string parameter) cannot be updated by the user. It only shows the value.
#DashBoard