#hi how to add . in the tax bot

10 messages · Page 1 of 1 (latest)

dapper pelican
#

hello i want help to make my bot Receive . in the numbers

shy ibexBOT
#
  • Consider reading #how-to-get-help to improve your question!
  • Explain what exactly your issue is.
  • Post the full error stack trace, not just the top part!
  • Show your code!
  • Issue solved? Press the button!
dapper pelican
daring pecanBOT
#

mdn Number.prototype.toLocaleString()
The toLocaleString() method of Number values returns a string with a language-sensitive representation of this number. In implementations with Intl.NumberFormat API support, this method simply calls Intl.NumberFormat.

dapper pelican
#

@crude silo

  let replaced = num
    .replace("k", "000")
    .replace("K", "000")
    .replace("m", "000000")
    .replace("M", "000000")
    .replace("b", "000000000")
    .replace("B", "000000000")
    .replace("t", "000000000000")
    .replace("T", "000000000000");
    
  let formattedNum = Number(replaced).toLocaleString();

  let waistTax = 2.50;
  let tax2 = Math.floor(replaced * waistTax / 100);
  let tax3 = Math.floor(tax2 + probot.taxs(replaced));                 
  let tax1 = Math.floor(tax2 + probot.taxs(probot.taxs(replaced)));

  let taxEmbed = new MessageEmbed()
    .setAuthor({ name: `ProBot Tax.`, iconURL: `` })
    .setColor("#382c5e")
    .setThumbnail('')
    .addFields(
      { name: '**💰 2.5% Tax:**', value: `${tax2}` },
      { name: '**💰 Price (1 Tax):**', value: `${probot.taxs(replaced)}` },
      { name: '**💰 Price (2 Taxes):**', value: `${probot.taxs(probot.taxs(replaced))}` },
      { name: '**💰 Price (1 Tax) + 2.5%:**', value: `${tax3}` },
      { name: '**💰 Price (2 Tax) + 2.5%:**', value: `${tax1}` }
    )
    .setFooter({ text: message.guild.name, iconURL: '' })
    .setTimestamp();

  message.reply({ embeds: [taxEmbed] })
  return;
}

can you do it?

crisp reef
#

What stops you from doing it?

dapper pelican
crisp reef
#

Then use Google translate to translate that website to your native language

dapper pelican
#

in translate