Message from JavaScript discussions

August 2020

— Math.round(quantity * -1)


Encoded_message = math.round{encodeURIComponent(:red\\_circle: \\*\\*${symbol} (${exchange}) - ${quantity*-1}\\*\\* sold at ${price} ${base}${special_msg})};

— You want to round only the quantity.. not the entire string

— Oh, so I can use () instead of {}?

— Or.. you need to round probably all of the values

— And without the $?

— No not instead - combine them. ${} says use this expression.

— And that expression can be anything really. a variable, a function call.. whatever

— So you can do ${Math.round(price)}

— Hmm, I will try it, thanks

— Encoded_message = encodeURIComponent(:red\\_circle: \\*\\*${symbol} (${exchange}) - ${Math.round(quantity*-1)}\\*\\* sold at ${Math.round(price)} ${base}${special_msg});

Message permanent page

— Ok, I will wait a bit for anything to come in, updated it