Template:Format Number

From RimWorld Wiki
Revision as of 20:15, 1 October 2024 by JuliaCat (talk | contribs) (Include FloatThree, even though so far it is unused)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Documentation icon Template documentation

Usage

This template is used to simplify formating numbers in the Template:Stat. Is is used like this:

{{Format Number|<number>|<toStringStyle>}}

Examples

  • {{Format Number|1.1111|Integer}} => 1
  • {{Format Number|1.1111|FloatOne}} or {{Format Number|1.1111|FloatMaxOne}} => 1.1
  • {{Format Number|1.1111|FloatTwo}} or {{Format Number|1.1111|FloatMaxTwo}} => 1.11
  • {{Format Number|1.1111|FloatTwoOrThree}} or {{Format Number|1.1111|FloatMaxThree}} => 1.111
  • {{Format Number|1.1111|PercentZero}} => 111%
  • {{Format Number|1.1111|PercentOne}} => 111.1%
  • {{Format Number|1.1111|PercentTwo}} => 111.11%
  • {{Format Number|24|Temperature}} => 24 °C (75.2 °F)
  • {{Format Number|24|TemperatureOffset}} => 24 °C (43.2 °F)
  • {{Format Number|24|Money}} => 24 Silver
  • {{Format Number|24|WorkAmount}} => 24 ticks (0.4 secs)