Formatter
About
The formatter Expansion allows you to format both numbers and text in various ways.
If you, for example, want to turn seconds into hours, minutes, etc. can you use %formatter_number_time_<seconds>%
to get the provided <seconds>
(i.e. 100
) as time in hours, minutes, etc (1m 40s
).
Placeholders
Numbers
%formatter_number_format_<number>%
%formatter_number_format_[locale]:[format]_<number>%
*%formatter_number_from:<time_unit>_to:<time_unit>_<number>%
%formatter_number_round_<number>%
%formatter_number_round_[precision]:[rounding_mode]_<number>%
%formatter_number_shorten_<number>%
%formatter_number_time_<number>%
%formatter_number_time_<time_unit>_<number>%
Notes:
*Both[locale]
and[format]
can be left blank to use whatever value is set in the config of PlaceholderAPI.
Please see the Oracle Javadocs for the syntax of[format]
and the wiki for the[locale]
syntax.
Text
%formatter_text_length_<text>%
%formatter_text_lowercase_<text>%
%formatter_text_replace_[target]_[replacement]_<text>%
*%formatter_text_substring_[start]:[end]_<text>%
**%formatter_text_uppercase_<text>%
Notes:
*To use underscrores (_
) as[target]
or[replacement]
will you need to use\
instead. **[start]
is zero-indexed (Starts at 0) while[end]
is not (Starts at 1). Leaving either value empty will result in the very start and very end of the text being used respectively