Шаблон:Significant figures

(Тағйири масир аз Шаблон:Sigfig)

0

Ҳуҷҷатгузорӣ

This template has two different functions dependent on input.

  1. If only one parameter is given the template counts the number of significant figures of the given number within the ranges 1012 to 10−12 and -10−12 to -1012. It ignores any digits outside of 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 0 [1]
  • {{significant figures|123.456|6}} gives 0 [2]
  • {{significant figures|123.456|5}} gives 0 [3]
  • {{significant figures|123.456|4}} gives 0 [4]

  • {{significant figures|123,456|3}} gives 0 [5]
  • {{significant figures|12345.6|3}} gives 0 [6]
  • {{significant figures|1234.56|3}} gives 0 [7]
  • {{significant figures|12.3456|3}} gives 0 [8]
  • {{significant figures|1.23456|3}} gives 0 [9]

  • {{significant figures|.123456|3}} gives 0 [10]
  • {{significant figures|.0123456|3}} gives 0 [11]
  • {{significant figures|.00123456|3}} gives 0 [12]
  • {{significant figures|0.123456|3}} gives 0 [13]
  • {{significant figures|0.0123456|3}} gives 0 [14]
  • {{significant figures|0.00123456|3}} gives 0 [15]

  • {{significant figures|123.456|2}} gives 0 [16]
  • {{significant figures|123.456|1}} gives 0 [17]
  • {{significant figures|123.456|0}} gives 0 [18]

  • {{significant figures|987654321|9}} gives 0 [19]
  • {{significant figures|987654321|8}} gives 0 [20]
  • {{significant figures|987654321|7}} gives 0 [21]
  • {{significant figures|987654321|6}} gives 0 [22]
  • {{significant figures|987654321|5}} gives 0 [23]
  • {{significant figures|987654321|4}} gives 0 [24]
  • {{significant figures|987654321|3}} gives 0 [25]
  • {{significant figures|987654321|2}} gives 0 [26]
  • {{significant figures|987654321|1}} gives 0 [27]

One parameter

  • {{significant figures|123400}} → 4 [28]
  • {{significant figures|12340}} → 4 [29]
  • {{significant figures|1234}} → 4 [30]
  • {{significant figures|123.4}} → 4 [31]
  • {{significant figures|12.34}} → 4 [32]
  • {{significant figures|1.234}} → 4 [33]

  • {{significant figures|0.1234}} → 4 [34]
  • {{significant figures|0.01234}} → 4 [35]
  • {{significant figures|0.001234}} → 4 [36]
  • {{significant figures|.1234}} → 4 [37]
  • {{significant figures|.01234}} → 4 [38]
  • {{significant figures|.001234}} → 4 [39]

  • {{significant figures|-123.4}} → 4 [40]
  • {{significant figures|-12.34}} → 4 [41]
  • {{significant figures|-1.234}} → 4 [42]