Question: I'm having a weird rounding problem.

Here is the setup (MySQL5.5 Percona; same in Mysql 5.7 CE):

```
CREATE TABLE `roundingtest` (
`RT_Double` DOUBLE NULL DEFAULT NULL,
`RT_Float` FLOAT NULL DEFAULT NULL,
`RT_Decimal` DECIMAL(10,3) NULL DEFAULT NULL
)
ENGINE=InnoDB;

```

Now enter in each of the 3 fields "1.785".

Now execute this query:

```
SELECT
1.785, ROUND(1.785, 2),
RT_Double, ROUND(RT_Double, 2),
RT_Float, ROUND(RT_Float, 2),
RT_Decimal, ROUND(RT_Decimal, 2)
FROM roundingtest

```

Here are the results:
[![rounding 2](https://i.stack.imgur.com/fQ3TE.png)](https://i.stack.imgur.com/fQ3TE.png)

If you round to one decimal place:
[![rounding 1](https://i.stack.imgur.com/09zWe.png)](https://i.stack.imgur.com/09zWe.png)

Someone please explain this behavior...

It's only correct with the DECIMAL field, even with only 3 decimal places.

Answer: 
The behaviour is introduced by assignment expressions, not inheritance. When you type:

```
@number = n, @id = i , @phone = ph, @adress =ad

```

What really means is

* Assign `ad` to `@address`
* Assign `ph` to `@phone`
* Assign `i` to `@id`
* Assign [`n`, the result of assigning `i` to `id`, which is `i`, the result of assigning `ph` to `phone`, which is `ph`, the result of assigning `ad` to `address`, which is `ad`] to `number`, which is a list.

So, the fix that problem, you will need to assign the properties individually, like so.

```
@number = n
@id = i 
@phone = ph
@adress = ad

```

Edit: you can also be smart and do a [destructured assignment](https://en.wikibooks.org/wiki/Ruby_Programming/Syntax/Operators#1._Assignment), like so...

```
@number , @id , @phone , @adress = [n, i, ph, ad]

```
> 
> Why is number being returned as an array?
> 
> 
> 

You assign multiple values to `@number` in your `Employee#initialize` method. The way Ruby represents multiple values is as an `Array`.

IOW:

```
foo = 1, 2, 3
# => [1, 2, 3]

```