Пређи на садржај

Шаблон:Frac/док

Iz Vojne Enciklopedije

{{#ifeq:док |док

    | 

{{#ifeq:show |show

|

        }}{{#if: |
         |   {{#ifexist:Шаблон:Frac
                  | [[Категорија:Документација {{#switch:Шаблон |Шаблон=шаблона |Модул=модула |Корисник=корисничких страница |#default=Википедије}}]]
                  | 
                 }}
        }}
    | 
   }}

This template builds an alternative form of common fractions. The template takes one, two, or three parameters: the optional integer (may be signed), the optional numerator and the required denominator; in this order.

Please do not subst:itute it. This template should not be used in science or mathematical articles, per MOS:FRAC and MOS:MATH#Fractions; use {{sfrac}} instead. To allow numerical sorting of a column containing fractions, use {{sortfrac}} instead. It is a combination of this template and {{sort}}.

{{frac|A|B|C}}
{{#if:C
|A BC
|{{#if:B
 |AB
 |{{#if:A
  |1A
  |⁄
 }}
}}

}} (integer, numerator and denominator)

{{frac|A|B}}
{{#if:
|A B{{{3}}}
|{{#if:B
 |AB
 |{{#if:A
  |1A
  |⁄
 }}
}}

}} (numerator and denominator)

{{frac|A}}
{{#if:
|A {{{2}}}{{{3}}}
|{{#if:
 |A{{{2}}}
 |{{#if:A
  |1A
  |⁄
 }}
}}

}} (denominator only)

{{frac}}
{{#if:
|{{{1}}} {{{2}}}{{{3}}}
|{{#if:
 |{{{1}}}{{{2}}}
 |{{#if:
  |1{{{1}}}
  |⁄
 }}
}}

}} (fraction slash only)

Examples

Numbers
{{#if:
|2 {{{2}}}{{{3}}}
|{{#if:
 |2{{{2}}}
 |{{#if:2
  |12
  |⁄
 }}
}}

}} ​{{#if:

|3 {{{2}}}{{{3}}}
|{{#if:
 |3{{{2}}}
 |{{#if:3
  |13
  |⁄
 }}
}}

}} ​{{#if:

|2 3{{{3}}}
|{{#if:3
 |23
 |{{#if:2
  |12
  |⁄
 }}
}}

}} ​{{#if:

|4 {{{2}}}{{{3}}}
|{{#if:
 |4{{{2}}}
 |{{#if:4
  |14
  |⁄
 }}
}}

}} ​{{#if:

|3 4{{{3}}}
|{{#if:4
 |34
 |{{#if:3
  |13
  |⁄
 }}
}}

}} ​{{#if:

|5 {{{2}}}{{{3}}}
|{{#if:
 |5{{{2}}}
 |{{#if:5
  |15
  |⁄
 }}
}}

}} ​{{#if:

|2 5{{{3}}}
|{{#if:5
 |25
 |{{#if:2
  |12
  |⁄
 }}
}}

}} ​{{#if:

|3 5{{{3}}}
|{{#if:5
 |35
 |{{#if:3
  |13
  |⁄
 }}
}}

}} ​{{#if:

|4 5{{{3}}}
|{{#if:5
 |45
 |{{#if:4
  |14
  |⁄
 }}
}}

}} ​{{#if:

|6 {{{2}}}{{{3}}}
|{{#if:
 |6{{{2}}}
 |{{#if:6
  |16
  |⁄
 }}
}}

}} ​{{#if:

|5 6{{{3}}}
|{{#if:6
 |56
 |{{#if:5
  |15
  |⁄
 }}
}}

}} ​{{#if:

|7 {{{2}}}{{{3}}}
|{{#if:
 |7{{{2}}}
 |{{#if:7
  |17
  |⁄
 }}
}}

}} ​{{#if:

|2 7{{{3}}}
|{{#if:7
 |27
 |{{#if:2
  |12
  |⁄
 }}
}}

}} ​{{#if:

|3 7{{{3}}}
|{{#if:7
 |37
 |{{#if:3
  |13
  |⁄
 }}
}}

}} ​{{#if:

|4 7{{{3}}}
|{{#if:7
 |47
 |{{#if:4
  |14
  |⁄
 }}
}}

}} ​{{#if:

|5 7{{{3}}}
|{{#if:7
 |57
 |{{#if:5
  |15
  |⁄
 }}
}}

}} ​{{#if:

|6 7{{{3}}}
|{{#if:7
 |67
 |{{#if:6
  |16
  |⁄
 }}
}}

}} ​{{#if:

|8 {{{2}}}{{{3}}}
|{{#if:
 |8{{{2}}}
 |{{#if:8
  |18
  |⁄
 }}
}}

}} ​{{#if:

|3 8{{{3}}}
|{{#if:8
 |38
 |{{#if:3
  |13
  |⁄
 }}
}}

}} ​{{#if:

|5 8{{{3}}}
|{{#if:8
 |58
 |{{#if:5
  |15
  |⁄
 }}
}}

}} ​{{#if:

|7 8{{{3}}}
|{{#if:8
 |78
 |{{#if:7
  |17
  |⁄
 }}
}}

}} ​{{#if:

|16 {{{2}}}{{{3}}}
|{{#if:
 |16{{{2}}}
 |{{#if:16
  |116
  |⁄
 }}
}}

}} ​{{#if:

|3 16{{{3}}}
|{{#if:16
 |316
 |{{#if:3
  |13
  |⁄
 }}
}}

}} ​{{#if:

|5 16{{{3}}}
|{{#if:16
 |516
 |{{#if:5
  |15
  |⁄
 }}
}}

}} ​{{#if:

|7 16{{{3}}}
|{{#if:16
 |716
 |{{#if:7
  |17
  |⁄
 }}
}}

}} ​{{#if:

|9 16{{{3}}}
|{{#if:16
 |916
 |{{#if:9
  |19
  |⁄
 }}
}}

}} ​{{#if:

|11 16{{{3}}}
|{{#if:16
 |1116
 |{{#if:11
  |111
  |⁄
 }}
}}

}} ​{{#if:

|13 16{{{3}}}
|{{#if:16
 |1316
 |{{#if:13
  |113
  |⁄
 }}
}}

}} ​{{#if:

|15 16{{{3}}}
|{{#if:16
 |1516
 |{{#if:15
  |115
  |⁄
 }}
}}

}}

Units
{{#if:
|m s{{{3}}}
|{{#if:s
 |ms
 |{{#if:m
  |1m
  |⁄
 }}
}}

}} ​{{#if:

|km h{{{3}}}
|{{#if:h
 |kmh
 |{{#if:km
  |1km
  |⁄
 }}
}}

}} ​{{#if:

|kg·m {{{3}}}
|{{#if:s²
 |kg·m
 |{{#if:kg·m
  |1kg·m
  |⁄
 }}
}}

}} ​{{#if:

|s {{{2}}}{{{3}}}
|{{#if:
 |s{{{2}}}
 |{{#if:s
  |1s
  |⁄
 }}
}}

}} ​{{#if:

|Mbit s{{{3}}}
|{{#if:s
 |Mbits
 |{{#if:Mbit
  |1Mbit
  |⁄
 }}
}}

}}

Notes

  • {{frac}} or ⁄ may be used to print out the fraction slash glyph " ⁄ ".

Parameters

{{#if:|погледајте месечни извештај о грешкама за овај шаблон.|Ово је {{#if:|TemplateData|TemplateData}} документација за овај шаблон, коришћена у Визуелном уређивачу и у другим алаткама; погледајте месечни извештај о грешкама за овај шаблон.}}

TemplateData за Frac

{{#ifeq:док|sandbox||

}} <templatedata>{ "description": "A template for displaying common fractions of the form int+num/den nicely. It supports 0–3 anonymous parameters with positional meaning.", "params": { "1": {

 "label": "leftmost part",
 "description": "Denominator if only parameter supplied. Numerator if 2 parameters supplied. Integer if 3 parameters supplied. If no parameter is specified the template will render a fraction slash only.",
 "type": "string/line",
 "required": false

}, "2": {

 "label": "middle-right part",
 "description": "Denominator if 2 parameters supplied. Numerator if 3 parameters supplied.",
 "inherits": "1"

}, "3": {

 "label": "rightmost part",
 "description": "Denominator, always.",
 "inherits": "1"

} }}</templatedata>

See also

|1 2{{{3}}}
|{{#if:2
 |12
 |{{#if:1
  |11
  |⁄
 }}
}}

}}), {{1/3}}, {{2/3}}, {{1/4}}, {{3/4}} – shorthands that use this template