الگو:Sigfig

از ویکی‌پدیا، دانشنامهٔ آزاد

0

توضیحات الگو[نمایش] [ویرایش] [تاریخچه] [پاکسازی]

This template has two different functions dependent on input.

  1. If only one parameter is given the template counts the number of ارقام معنی‌دار of the given number within the ranges 1012 to 10−12 and -10−12 to -1012. It ignores any digits outside this range.
  2. If two parameters are given the template rounds the first number to the number of significant figures given by the second.

Examples[ویرایش]

Two parameters[ویرایش]

  • {{significant figures|123.456|7}} gives ۱۲۳٫۴۵۶۰ [۱]
  • {{significant figures|123.456|6}} gives ۱۲۳٫۴۵۶ [۲]
  • {{significant figures|123.456|5}} gives ۱۲۳٫۴۶ [۳]
  • {{significant figures|123.456|4}} gives ۱۲۳٫۵ [۴]

  • {{significant figures|123,456|3}} gives ۱۲۳۰۰۰ [۵]
  • {{significant figures|12345.6|3}} gives ۱۲۳۰۰ [۶]
  • {{significant figures|1234.56|3}} gives ۱۲۳۰ [۷]
  • {{significant figures|12.3456|3}} gives ۱۲٫۳ [۸]
  • {{significant figures|1.23456|3}} gives ۱٫۲۳ [۹]

  • {{significant figures|.123456|3}} gives ۰٫۱۲۳ [۱۰]
  • {{significant figures|.0123456|3}} gives ۰٫۰۱۲۳ [۱۱]
  • {{significant figures|.00123456|3}} gives ۰٫۰۰۱۲۳ [۱۲]
  • {{significant figures|0.123456|3}} gives ۰٫۱۲۳ [۱۳]
  • {{significant figures|0.0123456|3}} gives ۰٫۰۱۲۳ [۱۴]
  • {{significant figures|0.00123456|3}} gives ۰٫۰۰۱۲۳ [۱۵]

  • {{significant figures|123.456|2}} gives ۱۲۰ [۱۶]
  • {{significant figures|123.456|1}} gives ۱۰۰ [۱۷]
  • {{significant figures|123.456|0}} gives ۰ [۱۸]

  • {{significant figures|987654321|9}} gives ۹۸۷۶۵۴۳۲۱ [۱۹]
  • {{significant figures|987654321|8}} gives ۹۸۷۶۵۴۳۲۰ [۲۰]
  • {{significant figures|987654321|7}} gives ۹۸۷۶۵۴۳۰۰ [۲۱]
  • {{significant figures|987654321|6}} gives ۹۸۷۶۵۴۰۰۰ [۲۲]
  • {{significant figures|987654321|5}} gives ۹۸۷۶۵۰۰۰۰ [۲۳]
  • {{significant figures|987654321|4}} gives ۹۸۷۷۰۰۰۰۰ [۲۴]
  • {{significant figures|987654321|3}} gives ۹۸۸۰۰۰۰۰۰ [۲۵]
  • {{significant figures|987654321|2}} gives ۹۹۰۰۰۰۰۰۰ [۲۶]
  • {{significant figures|987654321|1}} gives ۱۰۰۰۰۰۰۰۰۰
          ×۱۰۱-۸-۱
           [۲۷]

One parameter[ویرایش]

  • {{significant figures|123400}} → 4 [۲۸]
  • {{significant figures|12340}} → 4 [۲۹]
  • {{significant figures|1234}} → 4 [۳۰]
  • {{significant figures|123.4}} → 4 [۳۱]
  • {{significant figures|12.34}} → 4 [۳۲]
  • {{significant figures|1.234}} → 4 [۳۳]

  • {{significant figures|0.1234}} → 4 [۳۴]
  • {{significant figures|0.01234}} → 4 [۳۵]
  • {{significant figures|0.001234}} → 4 [۳۶]
  • {{significant figures|.1234}} → 3 [۳۷]
  • {{significant figures|.01234}} → 3 [۳۸]
  • {{significant figures|.001234}} → 3 [۳۹]

  • {{significant figures|-123.4}} → 4 [۴۰]
  • {{significant figures|-12.34}} → 4 [۴۱]
  • {{significant figures|-1.234}} → 4 [۴۲]

Supporting templates and modules[ویرایش]