Count the significant figures in a number, and round any number to a chosen number of significant figures. For science, engineering and homework.
Rules used: non-zero digits are always significant; zeros between significant digits count; leading zeros never count; trailing zeros count only when there is a decimal point. So 0.004560 has 4 significant figures and 1200 has 2 (the trailing zeros are ambiguous without a decimal point).
Significant figures are the digits in a number that carry real, measured meaning. They include all non-zero digits, any zeros between them, and trailing zeros after a decimal point, but not leading zeros, which only set the decimal place.
Without a decimal point, trailing zeros in a whole number could be placeholders or could be measured, so by the common convention they are not counted, giving 1200 two significant figures. Writing it as 1200. or 1.200 × 10³ makes the zeros significant.
It keeps the requested number of significant digits and rounds the rest, regardless of the decimal position. For example 0.004560 to 2 significant figures is 0.0046. This is common in science to match the precision of a measurement.