I found an answer from byjus.com

Error **Arithmetic Operations** Of **Significant Figures** - BYJU'S

Learn the **rules** for **arithmetic operation** of **significant figures** in a detailed manner.
... is **rounded off** so that it has the same number of digits as the **measurement** ...

For more information, see Error **Arithmetic Operations** Of **Significant Figures** - BYJU'S

Rules for Significant Figures

https://byjus.com/chemistry/significant-figures/

Given that

Total mass of the box = 2.30 kg

Masses of gold pieces = 20.15 g \text{ and } 20.17 g

a) Total mass of the box

Total mass of the box = 2.30 kg, Significant figures = 3

Masses of gold pieces 1 = 20.15 g = 0.02015 kg, Significant figures = 4

Masses of gold pieces 2 = 20.17 g = 0.02017 kg, Significant figures = 4

Total mass = 2.30 + 0.02015 + 0.02017

= 2.34032

= 2.3

Significant figures = 2

b) Difference in the mass of pieces

=20.17g-20.15g

= 0.02

Significant figures = 2