Formatnumber (Function) — Skript

Addon: Skript · Category: Function

Syntax

formatNumber(number: number, [format: string]) :: string

Description

Converts numbers to human-readable format. By default, '###,###' (e.g. '123,456,789') will be used for whole numbers and '###,###.##' (e.g. '123,456,789.00) will be used for decimal numbers. A hashtag '#' represents a digit, a comma ',' is used to separate numbers, and a period '.' is used for decimals. Will return none if the format is invalid. For further reference, see this <a href="https://docs.oracle.com/javase/7/docs/api/java/text/DecimalFormat.html" target="_blank">article</a>.

Examples

command /balance:
	aliases: bal
	executable by: players
	trigger:
		set {_money} to formatNumber({money::%sender's uuid%})
		send "Your balance: %{_money}%" to sender

View source