Quests icon indicating copy to clipboard operation
Quests copied to clipboard

Add possibility to edit number format

Open NoltoxGit opened this issue 1 year ago • 6 comments

Description of Feature

Hello, Would it be possible to add the ability to change the format of numbers in quests in the config of messages please ?

Exemple of config :

messages:
  # Set the format of all numbers related displays.
  # More informations: https://docs.oracle.com/javase/7/docs/api/java/text/DecimalFormat.html
  number-format: '#,##0.00'

Reason for Addition

To simplify the rounding of certain values and improve the display of quests.

Alternative Solutions

Any

Agreements

  • [X] I am running the latest version of Quests
  • [X] I am certain this request is unique and a similar issue is not currently open

Other

No response

NoltoxGit avatar Feb 20 '24 21:02 NoltoxGit

Is any number displayed in a weird way?

Krakenied avatar Feb 21 '24 14:02 Krakenied

Is any number displayed in a weird way?

It's not because of that, but because I'd like my values to be displayed with commas (to make it more visual), and not all glued together.

And I thought it would be nice to offer this way of editing the display of values, as do most plugins where it's possible to have values ("economy" plugins in an example).

image

NoltoxGit avatar Feb 21 '24 16:02 NoltoxGit

Allow to dsplay them with a space (like 1 038) would be fine for FR users :d

WarnDa avatar Mar 13 '24 11:03 WarnDa

Hello @Krakenied, Do you have any news about this ?

NoltoxGit avatar Apr 12 '24 19:04 NoltoxGit

i think i managed to implement it

Krakenied avatar Jun 14 '24 17:06 Krakenied

its in config.yml

number-formats:
  # decimal format used for processing float, double and BigDecimal placeholders
  floating:
    format: '#,##0.00'
    locale: 'en-US'
  # decimal format used for processing int, long and BigInteger placeholders
  integral:
    format: '#,##0'
    locale: 'en-US'

Krakenied avatar Jun 14 '24 17:06 Krakenied