Template:Format price/doc: Difference between revisions

From PT Wikitor Sandbox
No edit summary
 
m 1 revision imported
 
(No difference)

Latest revision as of 18:29, 8 May 2025

Lua error: Internal error: The interpreter has terminated with signal "11". Lua error: Internal error: The interpreter has terminated with signal "11". This template displays numbers typically representing prices in a pleasant way, ideally suited for articles. Numbers one thousand or greater are reduced down and rounded to a total of three digits followed by a multiplier text, and smaller numbers receive separators and exactly two digits to represent cents, which does not always happen with the {{formatnum:}} magic word.

Usage

Lua error: Internal error: The interpreter has terminated with signal "11".

Where:

  • value: the value that will be formatted and displayed (required).
  • digits: sets the digit in which a value lower than one thousand must be rounded, defaulting to "2" (cents) if unspecified.

Providing non-numeric parameters, failing to provide any parameter, or providing a negative value parameter, result all in a link to the NaN article. Despite its name, this template only handles the number-formatting, not any unit symbols – consider {{currency}} for that separate feature.

Examples

  • Green tickY Lua error: Internal error: The interpreter has terminated with signal "11". = 1.20
  • Green tickY Lua error: Internal error: The interpreter has terminated with signal "11". = 456.79
  • Green tickY Lua error: Internal error: The interpreter has terminated with signal "11". = 456.80
  • Green tickY Lua error: Internal error: The interpreter has terminated with signal "11". = 457
  • Green tickY Lua error: Internal error: The interpreter has terminated with signal "11". = 500
  • Green tickY $Lua error: Internal error: The interpreter has terminated with signal "11". = $1,234
  • Green tickY $Lua error: Internal error: The interpreter has terminated with signal "11". = $12,345
  • Green tickY $Lua error: Internal error: The interpreter has terminated with signal "11". = $123,456
  • Green tickY $Lua error: Internal error: The interpreter has terminated with signal "11". = $1 million
  • Green tickY ¥Lua error: Internal error: The interpreter has terminated with signal "11". = ¥98.8 trillion
  • Green tickY Lua error: Internal error: The interpreter has terminated with signal "11". atoms = 78.6 septillion atoms
Wrong
  • Red XN Lua error: Internal error: The interpreter has terminated with signal "11". = Lua error: Internal error: The interpreter has terminated with signal "11". (empty parameter)
  • Red XN Lua error: Internal error: The interpreter has terminated with signal "11". = Lua error: Internal error: The interpreter has terminated with signal "11". (empty first parameter)
  • Red XN Lua error: Internal error: The interpreter has terminated with signal "11". = Lua error: Internal error: The interpreter has terminated with signal "11". (negative values are invalid)
  • Red XN Lua error: Internal error: The interpreter has terminated with signal "11". = Lua error: Internal error: The interpreter has terminated with signal "11". (only numeric values are allowed)
  • Red XN Lua error: Internal error: The interpreter has terminated with signal "11". = Lua error: Internal error: The interpreter has terminated with signal "11". (overflow)

See also


No description.

Template parameters

ParameterDescriptionTypeStatus
value1

the value that will be formatted and displayed

Example
1,000
Numberrequired
digits2

sets the digit in which a value lower than one thousand must be rounded, defaulting to "2" (cents) if unspecified

Numbersuggested