-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfloat.html
More file actions
68 lines (63 loc) · 2.48 KB
/
float.html
File metadata and controls
68 lines (63 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<script type="text/javascript">
RED.nodes.registerType('toFloat',{
category: 'function',
color: '#FFAAAA',
defaults: {
name: {value:""},
toFixed: {value:""}
},
inputs:1,
outputs:1,
icon: "arrow-in.png",
label: function() {
return this.name||"toFloat";
}
});
</script>
<script type="text/x-red" data-template-name="toFloat">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-toFixed"><i class="icon-tag"></i> Decimal digits</label>
<input type="number" id="node-input-toFixed" placeholder="Example 1: 0.1 - 2: 0.01">
</div>
</script>
<script type="text/x-red" data-help-name="toFloat">
<p>Converts Binary Strings and Decimals Digits (32 bit) into IEEE-754 Floating Point numbers. Works also with arrays.</p>
<h3>Inputs</h3>
<dl class="message-properties">
<dt>payload
<span class="property-type"> string | Int </span>
</dt>
<dd> the number or the array of numbers to decode in Float 32 bit. </dd>
<dt class="optional">Decimals Number <span class="property-type">Number</span></dt>
<dd> max digits you want to keep after the '.'.</dd>
</dl>
<h3>Outputs</h3>
<ol class="node-ports">
<li>Standard output
<dl class="message-properties">
<dt>payload <span class="property-type">Number | Array</span></dt>
<dd>the standard output of the command.</dd>
</dl>
</li>
<li>Standard error
<dl class="message-properties">
<dt>payload <span class="property-type">string</span></dt>
<dd>the standard error of the command.</dd>
</dl>
</li>
</ol>
<h3>Details</h3>
<p><code>msg.payload</code> must be an Integer 32 bit or a Binary string like
'1000000010010001111010111000011' (3.14) if the type is wrong an error is returned,
if the input is an Array the index of the wrong element is returned with the error.
<p>Decimals digits can be configured in the node or if left blank the numbers will not
be truncated</p>
<h3>References</h3>
<ul>
<li><a href="https://github.com/robertsLando/node-red-contrib-float">GitHub</a> - the node github repository</li>
</ul>
</script>