> For the complete documentation index, see [llms.txt](https://ultimateshop.superiormc.cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ultimateshop.superiormc.cn/ultimateshop-wen-dang/dong-tai-jia-ge/dynamic-price-status-premium.md).

# 🔴动态价格状态 - 付费版

## 动态价格状态

可以在价格配置段的 `amount` 中使用 `{status}` 占位符，例如：

```yaml
    buy-prices:
      1:
        economy-plugin: Vault
        amount: '550+{buy-times-server}*0.2-{sell-times-server}*0.1'
        max-amount: 5500
        min-amount: 325
        placeholder: '&6{amount} Coins {status}' # <--- We use {status} here.
        start-apply: 0
```

使用此占位符时，必须确保 `amount` 中的第一个数值就是基础价格。例如上例的基础价格为 **550**。

也可以启用 `config.yml` 中的 `add-status-in-dynamic-price-placeholder`，让插件自动附加状态，无需为每个价格占位符手动添加。

## 可用占位符

* {base}：动态价格的基础价格，即 `amount` 中的第一个数值。
* {compare}：当前价格。

这些占位符也可以在 `{compare_<xxx>}` 占位符中使用。

## 显示价格变化百分比

可以通过公式计算基础价格与当前价格之间的变化百分比。找到 `config.yml` 中对应内容，按以下示例修改即可：

```yaml
  # Premium version only
  compare:
    up: '↑ &c+{math_(({compare}-{base})/{base}) * 100}% Debug: {compare} {base}'
    down: '↓ &a-{math_(({base}-{compare})/{base}) * 100}% Debug: {compare} {base}'
    same: '-'
```

## 效果展示

<figure><img src="https://2689690450-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlYKet01XJ63iL9pCCVzi%2Fuploads%2Fgit-blob-c71724ae552972deee62a4b51ffe5620efb4bcc9%2Fimage%20(4).png?alt=media" alt=""><figcaption></figcaption></figure>
