like a float:
if i == 2.0 i want to get: 2
if i == 2.3 or 2.23 i want to get: 2.3 or 2.23
thanks
like a float:
if i == 2.0 i want to get: 2
if i == 2.3 or 2.23 i want to get: 2.3 or 2.23
thanks
Use this expression. Just insert it wherever you want the result:
i.to_i == i ? i.to_i : i