tc
This tax calculator was built for The Magical Realm by mattc, with sections of code from Gouda The Cheese. I've even included comments in the tagscript to aid you in troubleshooting/ debugging in the future!
Privateunrated
Content
31 lines{=(comment): If anything breaks, cry.}
{=(comment): This tax calculator was built for The Magical Realm by mattc, with sections of code from Gouda The Cheese.}
{=(comment): This sets up the "math" variable, which replaces e, k, m. This cannot handle commas.}
{=(start):{replace(ee,*1000):{replace(ek,*1000):{replace(e*,*1000):{replace(e,*10^):{replace(k,*1000):{replace(m,*1000000):{replace(-,):{replace(|,):{args(1)}}}}}}}}}}
{=(comment):this removes any decimals, and only accepts integers into the "m" variable}
{=(m):{math:trunc({math:trunc({start})}*1)}}
{=(comment): This sets the different tax brackets into variable "tax", which then displays into the embed. This is NOT INVOLVED IN ANY MATH CALCULATIONS.}
{=(comment): Tax rates are as of 17 Dec 2020, 1-25,000 (0%), 25,001-50,000 (1%), 50,001 - 100,000 (3%), 100,001 - 749,999 (5%), 750,000 - 2,499,999 (8%), 2,500,000+ (15%)}
{=(tax):{if({args(1)}==):0|{if({m}<=25000):0|{if({m}<=49500):1|{if({m}<= 97000):3|{if({m}<= 712499):5|{if({m}<=2299999):8|{if({m}>= 2299999):15|error}}}}}}}%}
{=(pay):{if({args(1)}==):0|{if({m}<=25000):{m}|{if({m}<=49500):{math:trunc({m}/0.99)}|{if({m}<= 97000):{math:trunc({m}/0.97)}|{if({m}<= 712499):{math:trunc({m}/0.95+1)}|{if({m}<=2299999):{math:trunc({m}/0.92+1)}|{if({m}>= 949999):{math:trunc({m}/0.85+1)}|error}}}}}}}}
{=(lost):{math:trunc({pay}-{m})}}
{=(comment): This sets the embed options}
{embed(color):#4287f5}
{=(icon):{server(icon)}}
{=(comment): This section handles the displayed outcome, and includes a basic help function if only "tc" is entered in but not the numerical argument following tc.}
{=(display):{if({args(1)}==):It seems you aren't using this function correctly. Please enter in a valid number after `-tc`.
For example, `-tc 5m`, or `-tc 5000k`, or `-tc 5e6`, or `-tc 5000000`.
However, similar to Dank Memer, this function will **not** accept commas in your number.
Go try this function out using `-tc` now!|Amount entered: `{{if({args(1)}==):n/a|m}}`
Amount expected to pay: `{{if({args(1)}==):n/a|pay}}`
Amount lost to tax: `{{if({args(1)}==):n/a|lost}}`
Tax rate: `{{if({args(1)}==):n/a|tax}}`}}Embed
1 line{"color": 5198940, "title": "Dank Memer Tax Calculator", "footer": {"text": "Requested by {user} ({target(proper)})", "icon_url": "{user(icon)}"}, "thumbnail": {"url": "{icon}"}, "description": "{display}"}Raw JSON
{
"id": 461833,
"created_at": "2020-12-02T12:29:13.000Z",
"tag_name": "tc",
"nsfw": false,
"owner_id": "502114217219063809",
"uses": 290,
"description": "This tax calculator was built for The Magical Realm by mattc, with sections of code from Gouda The Cheese.\nI've even included comments in the tagscript to aid you in troubleshooting/ debugging in the future!",
"restricted": false,
"shared": false,
"deleted": false,
"safe": "unrated",
"hidden": false,
"guild_id": "502114449017274378",
"sharer": "502114217219063809",
"content": "{=(comment): If anything breaks, cry.}\n{=(comment): This tax calculator was built for The Magical Realm by mattc, with sections of code from Gouda The Cheese.}\n\n{=(comment): This sets up the \"math\" variable, which replaces e, k, m. This cannot handle commas.}\n{=(start):{replace(ee,*1000):{replace(ek,*1000):{replace(e*,*1000):{replace(e,*10^):{replace(k,*1000):{replace(m,*1000000):{replace(-,):{replace(|,):{args(1)}}}}}}}}}}\n\n{=(comment):this removes any decimals, and only accepts integers into the \"m\" variable}\n{=(m):{math:trunc({math:trunc({start})}*1)}}\n\n{=(comment): This sets the different tax brackets into variable \"tax\", which then displays into the embed. This is NOT INVOLVED IN ANY MATH CALCULATIONS.} \n{=(comment): Tax rates are as of 17 Dec 2020, 1-25,000 (0%), 25,001-50,000 (1%), 50,001 - 100,000 (3%), 100,001 - 749,999 (5%), 750,000 - 2,499,999 (8%), 2,500,000+ (15%)}\n{=(tax):{if({args(1)}==):0|{if({m}<=25000):0|{if({m}<=49500):1|{if({m}<= 97000):3|{if({m}<= 712499):5|{if({m}<=2299999):8|{if({m}>= 2299999):15|error}}}}}}}%}\n\n{=(pay):{if({args(1)}==):0|{if({m}<=25000):{m}|{if({m}<=49500):{math:trunc({m}/0.99)}|{if({m}<= 97000):{math:trunc({m}/0.97)}|{if({m}<= 712499):{math:trunc({m}/0.95+1)}|{if({m}<=2299999):{math:trunc({m}/0.92+1)}|{if({m}>= 949999):{math:trunc({m}/0.85+1)}|error}}}}}}}}\n\n{=(lost):{math:trunc({pay}-{m})}}\n\n{=(comment): This sets the embed options}\n{embed(color):#4287f5}\n{=(icon):{server(icon)}}\n\n{=(comment): This section handles the displayed outcome, and includes a basic help function if only \"tc\" is entered in but not the numerical argument following tc.}\n{=(display):{if({args(1)}==):It seems you aren't using this function correctly. Please enter in a valid number after `-tc`. \nFor example, `-tc 5m`, or `-tc 5000k`, or `-tc 5e6`, or `-tc 5000000`.\n\nHowever, similar to Dank Memer, this function will **not** accept commas in your number.\n\nGo try this function out using `-tc` now!|Amount entered: `{{if({args(1)}==):n/a|m}}`\nAmount expected to pay: `{{if({args(1)}==):n/a|pay}}`\nAmount lost to tax: `{{if({args(1)}==):n/a|lost}}`\nTax rate: `{{if({args(1)}==):n/a|tax}}`}}",
"embed": "{\"color\": 5198940, \"title\": \"Dank Memer Tax Calculator\", \"footer\": {\"text\": \"Requested by {user} ({target(proper)})\", \"icon_url\": \"{user(icon)}\"}, \"thumbnail\": {\"url\": \"{icon}\"}, \"description\": \"{display}\"}",
"last_fetched": "2026-10-20T23:21:44.684Z"
}