Showing 1 changed files with 15 additions and 0 deletions
+15
Nasal/knobs.nas
... ...
@@ -83,6 +83,21 @@ var knobsClass = {
83 83
                     break;
84 84
                 }
85 85
         }
86
+        elsif (contains(object, 'format')) {
87
+            var v = substr(val, find('%', object.format));
88
+            for (var c = 0; c < size(v); c +=1 )
89
+                if ((v[c] < `0` or v[c] > `9`)
90
+                        and v[c] != `.` and v[c] != ` `
91
+                        and v[c] != `-` and v[c] != `+`) {
92
+                    v = string.trim(substr(v, 0, c));
93
+                    break;
94
+                }
95
+            v += d * (contains(object, 'factor') ? object.factor : 1);
96
+            val = sprintf(object.format, v);
97
+            me.device.windows.window[me.device.windows.selected]
98
+                .setText(val);
99
+            object.text = val;
100
+        }
86 101
         elsif (find('time', object.type) > -1) {
87 102
             var (hh, mm, ss) = split(':', val);
88 103
             var time = hh * 3600 + mm * 60 + ss;