Iridium-Development / IridiumSkyblock

IridiumSkyblock: Skyblock Redefined
GNU General Public License v3.0
116 stars 102 forks source link

Some placeholders have no output + add rounded placeholders or output rounded values #832

Open RaptorXilef opened 6 months ago

RaptorXilef commented 6 months ago

Describe the Bug and Feature Request

  1. There are several placeholders in IridiumSkyblock. Some of them have an output if you want to use them in other plugins. For example, if we insert them into our scoreboard plugin. However, other placeholders work wonderfully.

Placeholder without output:

Working placeholders:

Expected behavior An output of a string or a value.




  1. If we use two specific placeholders, these are displayed with far too many decimal places, which has a negative impact on clarity. See screenshots.
    • %iridiumskyblock_island_bank_money% -> is: 22018.916400000002 -> expected: 22018.91
    • %iridiumskyblock_island_value% -> is: 272.40000000000003 -> expected: 272.4

The unexpected expenditure at %iridiumskyblock_island_bank_money% only occurs when a player deposits all his money into the bank. If only full amounts are deposited, the value is displayed correctly. I suspect that in this case Vault passes a value with more than 12 decimal places to IridiumSkyblock, so that it automatically continues to work with this value. Perhaps a solution could be found at this point. The unexpected output at %iridiumskyblock_island_value% always occurs.

Expected behavior The output of a value rounded to max. 2 decimal places.

Wish Can you limit the output of these variables/placeholders to two decimal places or insert two additional placeholders that also output the rounded values?

Server and Plugin Version /version

Previous version: git-Paper-461 (MC: 1.20.4)

/is about

- Plugin Name: IridiumSkyblock
- Plugin Version: 4.0.9
- Plugin Author: Peaches_MLG

Screenshots 2024,04,05-18,58,47-001 __ 2024,04,05-19,01,08-001

Should you require further information from me, please do not hesitate to contact me at any time.

sh0inx commented 6 months ago

does this also happen when setting the number formatter in settings?

configuration.yml

numberFormatter:
  numberAbbreviationDecimalPlaces: 2
RaptorXilef commented 6 months ago

Yes, I have set the settings as you described. The BUG described above in the display of decimal places still exists. Even changing the value to 1 or 0 does not change anything. My current attitude is:

configuration.yml

numberFormatter:
  numberAbbreviationDecimalPlaces: 2
  thousandAbbreviation: "K"
  millionAbbreviation: "M"
  billionAbbreviation: "B"
  trillionAbbreviation: "T"
  displayNumberAbbreviations: true

As a test, I used the placeholders in another plugin, "DecentHolograms", to check whether the incorrect output was due to the scoreboard plugin. Unfortunately, "DecentHolograms" displays the values with the same result.

2024,04,06-15,15,15-001