0.00450, leading and trailing zeros
- Input
- 0.00450
- Expected output
- 3 algarismos sig.
The two leading zeros do not count (leading-zero rule); the trailing zero counts because it comes after the decimal point.
count significant figures
Five rules decide whether a digit counts: non-zero digits always count, zeros between two non-zero digits count, zeros to the left of the first non-zero digit never count, and trailing zeros only count when the input has an explicit decimal point.
The two leading zeros do not count (leading-zero rule); the trailing zero counts because it comes after the decimal point.
The zero sits between two non-zero digits, so it counts even with no decimal point in the input.
The explicit decimal point makes both zeros count; without it, 120 would have only 2 guaranteed figures.
Significant figures are the digits that carry meaning regarding the precision of a measurement. They include all non-zero digits, sandwiched zeros, trailing zeros after a decimal point and, in some cases, leading zeros after the decimal. The more significant figures, the more precise the recorded measurement.
Position decides everything. A zero before the first non-zero digit (leading zero) never counts; a zero between two non-zero digits (sandwich zero) always counts; and a zero after the last non-zero digit (trailing zero) only counts when the input has an explicit decimal point.
Because each reaches 3 by a different path: 102 counts 1, the sandwich zero and 2; 0.00450 discards the two leading zeros and counts 4, 5 and the trailing zero after the point. The totals coincide, but the rules applied to each digit differ.
Yes: every typed character is classified with the reason behind the decision, such as sandwich zero, leading zero or trailing zero after a decimal point, letting you see exactly why a specific digit counted or not, instead of only the final total.
All calculations stay in your browser. No data is sent to any server.