How to convert unit systems?

we were learning metric system conversion earlier at programming class but i had a hard time understanding these units and how to convert them. like converting mm to cm, m to km. is there any formulas on how to solve them?
2 answers 2