{
  "address": "35c944c9dac676c8ecbc5ac8ed89f096",
  "category": "other",
  "question": "What is 100 plus 20% tax?",
  "answer": "120.00",
  "askedBy": {
    "kind": "guest",
    "display": "method deck",
    "stamped": false,
    "id": null
  },
  "answeredBy": "method",
  "madeAt": "2026-09-30T22:39:30.722Z",
  "validUntil": null,
  "validityClass": "forever",
  "sources": [
    {
      "label": "Value-Added Tax (VAT)",
      "url": "https://www.investopedia.com/terms/v/valueaddedtax.asp"
    }
  ],
  "supersedes": null,
  "supersededBy": null,
  "isSeed": false,
  "seedSource": null,
  "seedAttribution": null,
  "duplicateOfQid": null,
  "publishedAt": null,
  "unpublishedAt": null,
  "voteCount": 0,
  "queuedForSubstrate": false,
  "answerMethod": "method",
  "unsourced": false,
  "source": {
    "kind": "url",
    "value": "https://www.investopedia.com/terms/v/valueaddedtax.asp",
    "retrieved_utc": "2026-09-30T19:29:48Z"
  },
  "qsha256": "bf20853d07ac36eb8442d72e8232545602ade7140a920d6847869bf2de6c9544",
  "runOne": null,
  "cardContractVersion": "card_contract/1",
  "deck_id": "method-deck",
  "deck_title": "Method Deck",
  "method": {
    "name": "Price with VAT or sales tax",
    "version": "1",
    "source_url_or_file": "methods/price-with-vat-or-sales-tax.cjs",
    "sha256_of_method_file": "79d252e2608234d3a588bf5997ec535794db216ed11e8a0fce048b96d79478ab"
  },
  "receipt": {
    "inSubstrate": false,
    "local": true,
    "modelCallsAtMint": 0,
    "tokensAtMint": 0
  },
  "method_deck": {
    "inputs": [
      {
        "name": "price",
        "type": "number",
        "required": true,
        "description": "The starting price",
        "min": 0
      },
      {
        "name": "tax_rate_percent",
        "type": "number",
        "required": true,
        "description": "The tax (VAT or sales tax) rate as a percent",
        "min": 0
      },
      {
        "name": "direction",
        "type": "string",
        "required": true,
        "description": "\"add\" treats price as tax-exclusive and adds the tax; \"remove\" treats price as tax-inclusive and strips the tax out",
        "enum": [
          "add",
          "remove"
        ]
      }
    ],
    "outputs": [
      {
        "name": "result",
        "description": "The resulting price after adding or removing tax"
      }
    ],
    "steps": [
      "Convert the tax rate to a decimal: r = tax_rate_percent / 100.",
      "If direction is \"add\": result = price * (1 + r) (price is treated as the tax-exclusive amount).",
      "If direction is \"remove\": result = price / (1 + r) (price is treated as the tax-inclusive amount).",
      "Round result to 2 decimal places."
    ],
    "constants": [],
    "examples": [
      {
        "name": "worked example",
        "inputs": {
          "price": 100,
          "tax_rate_percent": 20,
          "direction": "add"
        },
        "expected": {
          "answer": "120.00"
        },
        "check": "By hand: 100 * (1 + 0.20) = 100 * 1.20 = 120 exactly."
      },
      {
        "name": "test vector: remove tax recovers the exclusive price",
        "inputs": {
          "price": 120,
          "tax_rate_percent": 20,
          "direction": "remove"
        },
        "expected": {
          "answer": "100.00"
        },
        "check": "By hand: 120 / 1.20 = 100 exactly, recovering the worked example's starting price."
      },
      {
        "name": "test vector: fractional tax rate",
        "inputs": {
          "price": 50,
          "tax_rate_percent": 8.25,
          "direction": "add"
        },
        "expected": {
          "answer": "54.13"
        },
        "check": "By hand: 50 * 1.0825 = 54.125, which rounds to 54.13 at 2 decimal places (round-half-up)."
      }
    ],
    "disclaimer": null,
    "deck_category": "currency"
  },
  "status": "minted",
  "kind": "method",
  "provenanceClass": "own_question",
  "provenance": {
    "schema": "card_provenance/2.0.0",
    "chain": [
      {
        "source": {
          "kind": "url",
          "value": "https://www.investopedia.com/terms/v/valueaddedtax.asp",
          "retrieved_utc": "2026-09-30T19:29:48Z"
        },
        "sha256": "78dbec4889545c6925a37063090c99525f342ba81cd5dcdb988c1b6b0e4b948e",
        "supersedes": null,
        "added_utc": "2026-09-30T22:39:30.722Z",
        "added_by": "method:Price with VAT or sales tax",
        "why": "the method that computed this answer",
        "check": null,
        "status_label": "pending",
        "signature": null
      }
    ]
  }
}
