Skabelon:Val/delimitnum/fraction
The Skabelon:Val/delimitnum/fraction is used by template {{Val}}. It formats a positive number lower than 1, using a given number of decimal digits after a decimal dot. It does not show the dot ("."), only the digits, in groups of 3 or 4, separated by thin spaces (small gaps).
Parametre
Parameter 1 is the required positive value to display lower than 1 (i.e. the fractional part of a positive real, with no spaces). Note that its value is not restricted in this template, as it is assumed to be valid (see {{Val/delimitnum}} for how it is computed). The amount in {1} could be an entire number (3400.65), but only the decimal portion will be displayed ("65").
Parameter 2 is the number of decimals to display (the count of digits after the decimal dot).
Eksempler
- 12345 → 12345
- 1234 → 1234
- 54321000 → 54321000
- 98765432101234 → 98765432101234
- 123 → 123
- 7 → 7
Messages
The following messages might appear:
- Too many digits. - when parameter 2 > 14.
- Expression error: Unexpected number. - when invalid spaces in number "0.123 456".
- Expression error: Unrecognised punctuation...{. - if exceeded expansion depth limit.
Performance impact
Template:Val/delimitnum/fraction limits the count of decimal digits to 14, based on the limit of computer math for the server computers. For higher counts, it shows: Too many digits.. In most uses, within the text of articles, using the template will not restrict performance, but when used inside the wikitext markup of very large templates, there are some restrictions. To display just 1 decimal digit, Val/delimitnum/fraction has an internal expansion depth of 4 levels, adding 1 level for each digit of the decimal portion.
For a 7-digit decimal (such as: 0.1234567), it uses a depth of 10 levels (4+6). At the maximum, for a 14-digit decimal (such as: 0.98765432101234), it uses a depth of 17 levels (4+13). In the rare event of exceeding the expansion depth limit, an expression error will be displayed, such as: Expression error: Unrecognised punctuation character "{". In general usage, most numbers rarely have more than 5 decimal digits (expansion depth of 8 levels).
Se også
- {{Val/delimitnum}} to format an entire number, including decimal portion.
- {{gaps}} to insert gaps between multiple numbers or letters.
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.









