summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiyush Dixit <79581397+PiyushDixit96@users.noreply.github.com>2021-05-16 15:17:48 +0530
committerGitHub <noreply@github.com>2021-05-16 15:17:48 +0530
commitcb942f87cad203404fd6765fbb4187ce1a63fe99 (patch)
tree97e2a154568c1c01236a1fca82738808800dbdb4
parenta18e33fa75f5554603f884eed544f11e7142ca02 (diff)
add trim func
-rw-r--r--index.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/index.js b/index.js
index 0ff0018..01e0cf1 100644
--- a/index.js
+++ b/index.js
@@ -66,8 +66,8 @@ function process_data(data) {
l: lastTradeQuantity,
z: Cumulative_filled_quantity
} = data;
- let str4 = symbol.slice(symbol.length - 4);
- let str3 = symbol.slice(symbol.length - 3);
+ let str4 = Trim(symbol,4)//symbol.slice(symbol.length - 4);
+ let str3 = Trim(symbol,3)//symbol.slice(symbol.length - 3);
let sy;
if(["USDT", "BUSD", "TUSD", "USDC", "BIDR", "IDRT", "BVND"].includes(str4)) {
sy = str4
@@ -141,3 +141,9 @@ function sendMessage(text) {
throw error;
});
}
+
+function Trim(input, last_n_chr) {
+ if (!input || !input.length) { return; }
+ //last_n_chr = +last_n_chr; //parse to int
+ return input.slice(last_n_chr);
+}