Skip to content

Commit ba5d7a4

Browse files
committed
Editor: toggle integer values through an ascii representation
1 parent a866cb3 commit ba5d7a4

File tree

1 file changed

+5
-1
lines changed
  • priv/node-red-frontend/red

1 file changed

+5
-1
lines changed

priv/node-red-frontend/red/red.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10263,11 +10263,13 @@ RED.utils = (function() {
1026310263
} else if (format === 'dateML' || format == 'dateL') {
1026410264
format = 'dec';
1026510265
} else if (format === "hex" ) {
10266-
format = 'bin';
10266+
format = 'ascii';
1026710267
} else if ( format === "dec" ) {
1026810268
format = 'hex';
1026910269
} else if (format === "bin" ) {
1027010270
format = 'oct';
10271+
} else if (format === "ascii" ) {
10272+
format = 'bin';
1027110273
} else {
1027210274
format = "oct"
1027310275
}
@@ -10294,6 +10296,8 @@ RED.utils = (function() {
1029410296
} else if (format === 'hex' || format === "oct" || format == "bin") {
1029510297
let unary = { "hex": ['x',16], "oct": ['o',8], "bin": ['b',2] }[format];
1029610298
element.text((obj < 0 ? "-" : "") + "0" + unary[0]+(Math.abs(obj)).toString(unary[1]));
10299+
} else if (format === 'ascii' ){
10300+
element.text(obj < 0 ? "-" : `'${String.fromCharCode(obj)}'`)
1029710301
}
1029810302
}
1029910303

0 commit comments

Comments
 (0)