Skip to content

Commit 314a14a

Browse files
authored
Merge pull request #1545 from starplanet/master
Fixed ToDecimal signed logic
2 parents 554a3b0 + dc8121e commit 314a14a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/core/operations/ToDecimal.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ class ToDecimal extends Operation {
4545
* @returns {string}
4646
*/
4747
run(input, args) {
48-
input = new Uint8Array(input);
4948
const delim = Utils.charRep(args[0]),
5049
signed = args[1];
5150
if (signed) {
52-
input = input.map(v => v > 0x7F ? v - 0xFF - 1 : v);
51+
input = new Int8Array(input);
52+
} else {
53+
input = new Uint8Array(input);
5354
}
5455
return input.join(delim);
5556
}

0 commit comments

Comments
 (0)