Jump to content

User:Diriector Doc/Sandbox/Number format/doc

From Wikipedia, the free encyclopedia

Summary

[edit]

Use this template to easily format a number. This template will replace misplaced separators and remove any unnecessary characters, including non-number characters and additional decimal points.

Usage

[edit]

{{User:Diriector Doc/Sandbox/Number format|<number>|separator=<separator>|radix point=<radix point>}}

Examples

[edit]
{{number format|123}}
{{number format|1234}}
{{number format|1234567890}}
{{number format|-1234567890}} -
{{number format|12345.67890}} 12 345.67890

{{number format|1234567890|separator=,}}
{{number format|1234567890|separator=~~}}
{{number format|1234567890|separator=}} Removes separators

{{number format|12345.67890|radix point=,}} 12 345,67890
{{number format|12345.67890|radix point=~~}} 12 345~~67890
{{number format|12345.67890|radix point=}} 12 34567890 Removes radix point. Makes number hard to read, not recommended!

{{number format|---1234567890}} -
{{number format|123456-7890}}
{{number format|123.4567.890}} 123.4567890 Ignores second decimal point
{{number format|1 234,567'890}} Convertes everything to a single format
{{number format|1 23 45678 90}} Fixes improper formating
{{number format|12a4567b90}}
{{number format|1**********0}}
{{number format|<nowiki>12345</nowiki>}} ???
{{number format|1234567890123456789}} No real limit to integer size
{{number format|1234567890 <ref>Some reference</ref>}} ???
{{number format|1234567890 [[Some link]]}}
{{number format|Just text}}
{{number format|}}
{{number format}} Template thinks {{{1}}} was input

See also

[edit]


Template Data

[edit]

This template will format an input number to fit any style and remove unnecessary characters with ease.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Number1

The number to be formatted

Default
1
Example
123.123
Numberrequired
Separatorseparator

The decimal separator for numbers 1000 and larger

Default
<space>
Example
,
Stringoptional
Radix Pointradix point

The symbol that separates the integer from the decimal value

Default
.
Example
,
Stringoptional
  1. ^ Some reference