సహాయం:చమత్కార పదాలు: కూర్పుల మధ్య తేడాలు
Content deleted Content added
చి Bot: Migrating interwiki links, now provided by Wikidata on d:q4483522 |
Arjunaraoc (చర్చ | రచనలు) చి →ఫార్మాటింగు: (అంగ్ల వికీనుండి విభాగం తాజా) |
||
పంక్తి 271:
=== ఫార్మాటింగు ===
=== Formatting === <!--T:189-->
</translate>
{| class="wikitable"
! width="10%" | <translate><!--T:190--> Usage</translate>
! width="40%" | <translate><!--T:191--> Input → Output</translate>
! <translate><!--T:192--> Description</translate>
! width="10%" | <translate><!--T:193--> Version</translate>
|-
| <code><nowiki>{{
<code><nowiki>{{formatnum:</nowiki>''unformatted number''<nowiki>|NOSEP}}</nowiki></code>
|
* <translate><!--T:194--> Simple:</translate>
** <code><nowiki>{{formatnum:987654321.654321}}</nowiki></code> <br/> → {{formatnum:987654321.654321}}
** <code><nowiki>{{formatnum:</nowiki>{{formatnum:987654321.654321}}<nowiki>|R}}</nowiki></code> <br/> → {{formatnum:{{formatnum:987654321.654321}}|R}}
* <translate><!--T:195--> Advanced:</translate>
** <code><nowiki>{{formatnum:{{formatnum:987654321.654321}}|R}}</nowiki></code> <br/> → {{formatnum:{{formatnum:987654321.654321}}|R}} <translate><!--T:196--> (on any locale)</translate>
** <code><nowiki>{{formatnum:00001}}</nowiki></code> <br/> → {{formatnum:00001}}
** <code><nowiki>{{formatnum:987654321.654321 |NOSEP}}</nowiki></code> <br/> → {{formatnum:987654321.654321 |NOSEP}}
** <translate><!--T:197--> Examples with [[w:Bengali numerals|{{#language:bn|en}} locale]]:</translate>
*** <code><nowiki>{{formatnum:987654321.654321}}</nowiki></code> <br/> → ৯৮,৭৬,৫৪,৩২১.৬৫৪৩২১
*** <code><nowiki>{{formatnum:987654321.654321 |NOSEP}}</nowiki></code> <br/> → ৯৮৭৬৫৪৩২১.৬৫৪৩২১
*** <code><nowiki>{{formatnum:৯৮,৭৬,৫৪,৩২১.৬৫৪৩২১ |R}}</nowiki></code> <br/> → 987654321.654321
----
<translate><!--T:198--> Unsupported:</translate> <br />
<code><nowiki>{{formatnum:{{formatnum:987.654.321}}}}</nowiki></code> <br/> → 987 654 321 <translate><!--T:199--> (e.g. with Italian locale)</translate>
----
<translate><!--T:200--> Examples of wrong input (unreliable output), with or without <code>|R</code>:</translate> <br />
<code><nowiki>{{formatnum:987,654.321|R}}</nowiki></code> <translate><!--T:201--> (the least broken)</translate> <br/>
<code><nowiki>{{formatnum:987.654,321|R}}</nowiki></code> <br/>
<code><nowiki>{{formatnum:987 654,321|R}}</nowiki></code> <br/>
<code><nowiki>{{formatnum:987&nbsp;654,321|R}}</nowiki></code>
| <translate><!--T:202-->
Takes an unformatted number ([[w:Arabic numerals|Arabic]], no group separators and <code>.</code> as decimal separator) and outputs it in the localized digit script and formatted with decimal and decimal group separators, according to the wiki's default locale. <br />
The <code><nowiki>|R</nowiki></code> parameter can be used to reverse the behavior, for use in mathematical situations: it's reliable and should be used only to deformat numbers which are known to be formatted exactly as formatnum formats them with the wiki's locale.</translate><br/>
<translate><!--T:205--> The <code>NOSEP</code> ("no separators") parameter means that no group / decimal separators are changed; formatnum will only transform the digits themselves in languages which don't use the [[w:en:Hindu–Arabic numeral system|Hindu–Arabic numeral system]]. <code>NOSEP</code> can also prevent non-standard digit groupings you wouldn't expect.</translate>
{{warning|1=<translate><!--T:203--> Leading zeroes are not removed, you can use <nowiki>{{#expr:00001}}</nowiki> instead if you have <tvar|ext-pf>{{ll|Extension:ParserFunctions}}</> installed.</translate>}}<br />
{{warning|1=<translate><!--T:204--> If you don't input numbers in the exact format required, don't expect any reliable output, especially on non-English wikis.</translate>}}<br />
----
<translate>
<!--T:206-->
If you really need to format (according the wiki's locale) a number in unknown input format, you could try and use <code>formatnum</code> two times (but not if it can have a decimal group, or its separator will be eaten or the number won't be formatted). Be aware that this is more a hack than a regular way to proceed, thus the output may be not reliable.
</translate>
| {{MW version|version=1.7|compact=y|comment=and after}} <br />{{MW version|version=1.13|compact=y|comment=and after|r=32012}}
|-
|
<code><nowiki>{{#formatdate:</nowiki>''date''<nowiki>}}</nowiki></code><br />
<code><nowiki>{{#dateformat:</nowiki>''date''{{!}}''format''<nowiki>}}</nowiki></code><br />
<code><nowiki>{{#formatdate:</nowiki>''date''{{!}}''format''<nowiki>}}</nowiki></code>
|
<code><nowiki>{{#dateformat:25 dec 2009|ymd}}</nowiki></code> <br/>
→ {{#dateformat:25 dec 2009|ymd}} <translate><!--T:207--> (your pref), 2009 Dec 25 (default)</translate> <br/>
<code><nowiki>{{#formatdate:dec 25,2009|dmy}}</nowiki></code> <br/>
→ {{#formatdate:dec 25,2009|dmy}} <translate><!--T:208--> (your pref), 25 Dec 2009 (default)</translate> <br/>
<code><nowiki>{{#dateformat:2009-12-25|mdy}}</nowiki></code> <br/>
→ {{#dateformat:2009-12-25|mdy}} <translate><!--T:209--> (your pref), December 25, 2009 (default)</translate> <br/>
<code><nowiki>{{#formatdate:2009 dec 25|ISO 8601}}</nowiki></code> <br/>
→ {{#formatdate:2009 dec 25|ISO 8601}} <translate><!--T:210--> (your pref), 2009-12-25 (default)</translate> <br/>
<code><nowiki>{{#dateformat:25 decEmber|mdy}}</nowiki></code> <br/>
→ {{#dateformat:25 decEmber|mdy}} <translate><!--T:211--> (your pref), DecEmber 25 (default)</translate> <br/>
<translate><!--T:212-->
''Note:'' In the example hereinbefore, "your pref" refers to your date preference on the current MediaWiki wiki only.
</translate>
| <translate><!--T:213--> Formats an unlinked date based on user "date format" preference, and adds metadata tagging it as a formatted date. For logged-out users and those who have not set a date format in their preferences, dates can be given a default: <code>mdy</code>, <code>dmy</code>, <code>ymd</code>, <code>ISO 8601</code> (all case sensitive). If only the month and day are given, only <code>mdy</code> and <code>dmy</code> are valid. If a format is not specified or is invalid, the input format is used as a default. If the supplied date is not recognized as a valid date (specifically, if it contains any metadata such as from a nested use of these or similar templates), it is rendered unchanged, and no (additional) metadata is generated.</translate> <br/>
{{warning|1=<translate><!--T:214--> Although the ISO 8601 standard requires that dates be in the Gregorian calendar, the ISO parameter in this function will still format dates that fall outside the usual Gregorian range (e.g. dates prior to 1583). Also, the magic word cannot properly convert between negative years (used with ISO 8601) and years BC or years BCE (used in general writing).</translate>}}
| {{MW version|version=1.15|compact=y|comment=and after|r=48249}}
|-
| <code><nowiki>{{
| <code><nowiki>{{
| {{Anchor|lc|Lc|LC}}<translate><!--T:215--> The lowercase input.</translate>
| {{MW version|version=1.5|compact=y|comment=and after}}
|-
| <code><nowiki>{{
| <code><nowiki>{{
| {{Anchor|lcfirst|Lcfirst|LCFIRST}}<translate><!--T:216--> The input with the <u>very first</u> character lowercase.</translate>
| {{MW version|version=1.5|compact=y|comment=and after}}
|-
| <code><nowiki>{{
| <code><nowiki>{{
| {{Anchor|uc|Uc|UC}}<translate><!--T:217--> The uppercase input.</translate>
| {{MW version|version=1.5|compact=y|comment=and after}}
|-
| <code><nowiki>{{
| <code><nowiki>{{
| {{Anchor|ucfirst|Ucfirst|UCFIRST}}<translate><!--T:218--> The input with the <u>very first</u> character uppercase.</translate>
| {{MW version|version=1.5|compact=y|comment=and after}}
|-
| <code><nowiki>{{padleft:
<code><nowiki>{{padleft:xyz|</nowiki>''strlen''<nowiki>|</nowiki>''char''<nowiki>}}</nowiki></code> <br />
<code><nowiki>{{padleft:
| <code><nowiki>{{padleft:
<code><nowiki>{{padleft:
<code><nowiki>{{padleft:
<code><nowiki>{{padleft:
<code><nowiki>{{padleft:|1|xyz}}</nowiki></code> → {{padleft:|1|xyz}}
<translate><!--T:219--> (first character of the string)</translate> <br />
| <translate><!--T:220-->
Inserts a string of padding characters (character chosen in third parameter; default "0") of a specified length (second parameter) next to a chosen base character or variable (first parameter). The final digits or characters in the base replace the final characters in the padding; i.e. <code><nowiki>{{padleft:44|3|0}}</nowiki></code> produces {{padleft:44|3}}. The padding string may be truncated if its length does not evenly divide the required number of characters.
<!--T:221-->
Only the first character of the third parameter is used in versions up to 1.12, but by version 1.15, all the characters are used.
<!--T:222-->
'''[[<tvar|1>bugzilla:16852</>|Bug]] (fixed in <tvar|2>[[rev:45734|r45734]]</>):''' multibyte characters are interpreted as two characters, which can skew width. These also cannot be used as padding characters.</translate>
| {{MW version|version=1.8|compact=y|comment=and after}}
|-
| <code><nowiki>{{padright:xyz|</nowiki>''stringlength''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{padright:xyz|</nowiki>''strlen''<nowiki>|</nowiki>''char''<nowiki>}}</nowiki></code> <br /><code><nowiki>{{padright:xyz|</nowiki>''strlen''<nowiki>|</nowiki>''string''<nowiki>}}</nowiki></code>
| <code><nowiki>{{padright:xyz|5}}</nowiki></code> → {{padright:xyz|5}} <br />
<code><nowiki>{{padright:xyz|5|_}}</nowiki></code> → {{padright:xyz|5|_}} <br />
<code><nowiki>{{padright:xyz|5|abc}}</nowiki></code> → {{padright:xyz|5|abc}} <br />
<code><nowiki>{{padright:xyz|2}}</nowiki></code> → {{padright:xyz|2}} <br />
<code><nowiki>{{padright:|1|xyz}}</nowiki></code> → {{padright:|1|xyz}} <br />
| <translate><!--T:223--> Identical to <code>padleft</code> but adds padding characters to the right side.</translate>
| {{MW version|version=1.8|compact=y|comment=and after}}
|}
<translate><!--T:224-->
'''See also:''' <tvar|ext-stringfunctions>{{ll|Extension:StringFunctions}}</>.
</translate>
{{anchor|Localization|Localisation}}
<translate>
==మూస మార్పిడులు ==
|