From 73a39fa3ceba9f04bda0d7c96d6993732700add3 Mon Sep 17 00:00:00 2001 From: starplanet Date: Wed, 5 Apr 2023 18:25:37 +0800 Subject: [PATCH] fix: fix ToDecimal signed logic --- src/core/operations/ToDecimal.mjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/operations/ToDecimal.mjs b/src/core/operations/ToDecimal.mjs index 65798a7c..50db41f6 100644 --- a/src/core/operations/ToDecimal.mjs +++ b/src/core/operations/ToDecimal.mjs @@ -45,11 +45,12 @@ class ToDecimal extends Operation { * @returns {string} */ run(input, args) { - input = new Uint8Array(input); const delim = Utils.charRep(args[0]), signed = args[1]; if (signed) { - input = input.map(v => v > 0x7F ? v - 0xFF - 1 : v); + input = new Int8Array(input); + } else { + input = new Uint8Array(input); } return input.join(delim); }