1. Change all the variables so there is no my_ in front of each one. make sure you change the name everywhere, not just where you used = to set them.
2. Try to write some variables that convert the inches and pounds to centimeters and kilograms. Do not just type in the measurements. Work out the math in Ruby.
I converted it just fine, however not to the desired decimal points, so I’ve googled some more into this.
Here are a few ways to do rounding numbers.
1. .round(#) – rounding to desired #
2. .floor – rounding down to the closes integer.
3. .ceil – rounding up to the closes integer.
4. ‘%.2f’% – I was working on my height, the outcome was 165.1, so how do I make it to 165.10? I found this to work pretty well, it rounds (up and down) to the closes number.
There are more ways to do so, however it requires making a new class, which I find it too inconvenient, unless you need to specifically round up or down a number. Here’s the link to read more. Here’s another link.