ढाँचा:Least

स्वतन्त्र विश्वकोश, नेपाली विकिपिडियाबाट
Jump to navigation Jump to search
Template documentation[view] [edit] [history] [purge]

This helper template returns the least of two numbers. The motivation arises from a need to restrict the size of images displayed in Infoboxes. It allows the editor to specify the width of an image. If the requested width is greater than the maximum width, the maximum width is returned. Otherwise the requested width is returned. It is designed to fail gracefully.

Usage[सम्पादन गर्ने]

{{least | requested_width | max_width }}

If the requested value is greater than the maximum value then the maximum value is returned.
If the requested value is less than the maximum value then the requested value is returned.
If the requested value is undefined or non numeric then the maximum value is returned.
If the maximum value is undefined then the result is undefined.

Examples[सम्पादन गर्ने]

{{least|200|100}} → 100
{{least|100|200}} → 100
{{least||200}} → 200
{{least|100px|200}} → 200
{{least|200|}}

See also[सम्पादन गर्ने]