User:Diriector Doc/Sandbox/Number format
| This template uses Lua: |
Summary
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
{{User:Diriector Doc/Sandbox/Number format|<number>|separator=<separator>|radix point=<radix point>}}
Examples
{{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
- {{formatnum:}} magic word
- {{formatnum:}} magic word on www.mediawiki.org
Template Data
This template will format an input number to fit any style and remove unnecessary characters with ease.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Number | 1 | The number to be formatted
| Number | required |
| Separator | separator | The decimal separator for numbers 1000 and larger
| String | optional |
| Radix Point | radix point | The symbol that separates the integer from the decimal value
| String | optional |
- ^ Some reference
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.