percent

Privateunrated

Content

62 lines
{=(COMMENT):Emoji used as a "bullet point" for the instructions.}
{=(twr):<:happyfrog:777542410958798858>}

{=(COMMENT):Prefix and tag name used. Will be shown in the instructions to fit the tag usage in your server.
Reminder: You can use "!tag alias per percent" to add an alias called "per" to the "percent" tag.}
{=(prefix):?}
{=(tagname):percent}

{=(COMMENT):Instructions, with command usage examples and math formulas.}
{=(example):{twr} — **What is Dank Bank?**
Dank Bank is a safe and secure way for members of Jamez to deposit and withdraw Dank coins. This is useful if you’re worried about being robbed or heisted in other servers. Loans can be arranged on a per-person basis. Please message James to discuss this.

{twr} — **How do I use the Dank Bank % Calculator?**
You would use it like you would any normal calculator. You can also use it to calculate Dank tax when sending/receiving coins. For example:

**What is % of x?**
`?per 5% of 200000`

**What is the % increase/decrease?**
`?per 900000 + 10%`
`?per 500000 - 5%`

**What is x/y in %?**
`?per 5/156`}

{=(COMMENT):Creates artificial named options depending on some conditions. Returns "fail" when none is met.}
{=(option):{if({in(/):{args}}==true):outof|{if({in(of):{args}}==true):perof|{if({in(+):{args}}==true):increase|{if({in(-):{args}}==true):decrease|fail}}}}}

{=(COMMENT):Sets the actual numbers to use in each of their corresponding formula later.}
{=(num.outof):{replace( ,):{args(1):/}} {replace( ,$&):{args(2):/}}}
{=(num.perof):{replace( ,):{args(1):%}} {replace( ,$&):{args(2): of }}}
{=(num.increase):{replace( ,):{args(1):+}} {replace( ,$&):{replace(%,):{args(2):+}}}}
{=(num.decrease):{replace( ,):{args(1):-}} {replace( ,$&):{replace(%,):{args(2):-}}}}

{=(COMMENT):Grabs the first and second item of the number variable above to actually be able to use them.}
{=(num1):{num.{option}(1)}}
{=(prenum2):{num.{option}(2)}}
{=(COMMENT):The "$&" part allows the user to type spaces and even text freely after their query for more versality.}
{=(num2):{prenum2(2):$&}}

{=(COMMENT):Math formula of each option.}
{=(form.outof):{m:{num1}*100/{num2}}Z%}
{=(form.perof):{m:{num2}*{num1}/100}}
{=(form.increase):{m:abs({num1}*(100+{num2})/100)}Z}
{=(form.decrease):{m:abs({num1}*(100-{num2})/100)}Z}

{=(COMMENT):Result, with .0 removed when the result should be truncated.}
{=(result):{replace(%,):{replace(Z,):{replace(.0Z,):{form.{option}}}}}}
{=(COMMENT):Rounded result, with a custom amount of decimals.}
{=(decimals):2}
{=(rresult):{m:round({result}*10^{decimals})/10^{decimals}}{if({option}==outof):%}}

{=(COMMENT):Conditional title depending on the option found.}
{=(title.outof):Percentage of {num1}/{num2}:}
{=(title.perof):{num1}% of {num2}:}
{=(title.increase):{num1} + {num2}%:}
{=(title.decrease):{num1} - {num2}%:}

{=(COMMENT):The *only* thing we call in the embed's field as the output. Returns the instructions if no argument or no available option is found, otherwise returns a custom title and the query's result.}
{=(title):{title.{option}}}
{=(output):{any({1}==|{option}==fail):{example}|**{title}**
{rresult}}}

Embed

1 line
{"color": 4289797, "title": "Dank Bank % Calculator ", "footer": {"text": "Use ?per for information and instructions"}, "thumbnail": {"url": "https://images-ext-2.discordapp.net/external/ZB96qoiOZIimMUudpQT8JwAf8Gz2YpDLursLXudnHxk/%3Fsize%3D1024/https/cdn.discordapp.com/avatars/809407574600450080/f30e9a511f856da29b56b002fdbd74d0.png"}, "description": "{output}"}
Raw JSON
{
  "id": 680353,
  "created_at": "2021-03-16T13:54:40.000Z",
  "tag_name": "percent",
  "nsfw": false,
  "owner_id": "662407182909964288",
  "uses": 17,
  "description": null,
  "restricted": false,
  "shared": false,
  "deleted": false,
  "safe": "unrated",
  "hidden": false,
  "guild_id": "686253887211962384",
  "sharer": "662407182909964288",
  "content": "{=(COMMENT):Emoji used as a \"bullet point\" for the instructions.}\n{=(twr):<:happyfrog:777542410958798858>}\n\n{=(COMMENT):Prefix and tag name used. Will be shown in the instructions to fit the tag usage in your server.\nReminder: You can use \"!tag alias per percent\" to add an alias called \"per\" to the \"percent\" tag.}\n{=(prefix):?}\n{=(tagname):percent}\n\n{=(COMMENT):Instructions, with command usage examples and math formulas.}\n{=(example):{twr} — **What is Dank Bank?**\nDank Bank is a safe and secure way for members of Jamez to deposit and withdraw Dank coins. This is useful if you’re worried about being robbed or heisted in other servers. Loans can be arranged on a per-person basis. Please message James to discuss this.\n\n{twr} — **How do I use the Dank Bank % Calculator?**\nYou would use it like you would any normal calculator. You can also use it to calculate Dank tax when sending/receiving coins. For example:\n\n**What is % of x?**\n`?per 5% of 200000`\n\n**What is the % increase/decrease?**\n`?per 900000 + 10%`\n`?per 500000 - 5%`\n\n**What is x/y in %?**\n`?per 5/156`}\n\n{=(COMMENT):Creates artificial named options depending on some conditions. Returns \"fail\" when none is met.}\n{=(option):{if({in(/):{args}}==true):outof|{if({in(of):{args}}==true):perof|{if({in(+):{args}}==true):increase|{if({in(-):{args}}==true):decrease|fail}}}}}\n\n{=(COMMENT):Sets the actual numbers to use in each of their corresponding formula later.}\n{=(num.outof):{replace( ,):{args(1):/}} {replace( ,$&):{args(2):/}}}\n{=(num.perof):{replace( ,):{args(1):%}} {replace( ,$&):{args(2): of }}}\n{=(num.increase):{replace( ,):{args(1):+}} {replace( ,$&):{replace(%,):{args(2):+}}}}\n{=(num.decrease):{replace( ,):{args(1):-}} {replace( ,$&):{replace(%,):{args(2):-}}}}\n\n{=(COMMENT):Grabs the first and second item of the number variable above to actually be able to use them.}\n{=(num1):{num.{option}(1)}}\n{=(prenum2):{num.{option}(2)}}\n{=(COMMENT):The \"$&\" part allows the user to type spaces and even text freely after their query for more versality.}\n{=(num2):{prenum2(2):$&}}\n\n{=(COMMENT):Math formula of each option.}\n{=(form.outof):{m:{num1}*100/{num2}}Z%}\n{=(form.perof):{m:{num2}*{num1}/100}}\n{=(form.increase):{m:abs({num1}*(100+{num2})/100)}Z}\n{=(form.decrease):{m:abs({num1}*(100-{num2})/100)}Z}\n\n{=(COMMENT):Result, with .0 removed when the result should be truncated.}\n{=(result):{replace(%,):{replace(Z,):{replace(.0Z,):{form.{option}}}}}}\n{=(COMMENT):Rounded result, with a custom amount of decimals.}\n{=(decimals):2}\n{=(rresult):{m:round({result}*10^{decimals})/10^{decimals}}{if({option}==outof):%}}\n\n{=(COMMENT):Conditional title depending on the option found.}\n{=(title.outof):Percentage of {num1}/{num2}:}\n{=(title.perof):{num1}% of {num2}:}\n{=(title.increase):{num1} + {num2}%:}\n{=(title.decrease):{num1} - {num2}%:}\n\n{=(COMMENT):The *only* thing we call in the embed's field as the output. Returns the instructions if no argument or no available option is found, otherwise returns a custom title and the query's result.}\n{=(title):{title.{option}}}\n{=(output):{any({1}==|{option}==fail):{example}|**{title}**\n{rresult}}}",
  "embed": "{\"color\": 4289797, \"title\": \"Dank Bank % Calculator \", \"footer\": {\"text\": \"Use ?per for information and instructions\"}, \"thumbnail\": {\"url\": \"https://images-ext-2.discordapp.net/external/ZB96qoiOZIimMUudpQT8JwAf8Gz2YpDLursLXudnHxk/%3Fsize%3D1024/https/cdn.discordapp.com/avatars/809407574600450080/f30e9a511f856da29b56b002fdbd74d0.png\"}, \"description\": \"{output}\"}",
  "last_fetched": "2026-10-21T00:42:28.754Z"
}