Hi,
I would like to "cap" a number in ruby (on rails). For instance I have has a result of a function a float but I need an int.
I have very specific instructions, here are examples: if I get 1.5 I want 2 if but if I get 2.0 I want 2 (and not 3)
so doing number.round(0) + 1
it won't work.
I could write this function but, I sure it already exists.
If nevertheless it does not exist, where should I create my cap function ?