I'm been trying to get only decimal point value of a floating point number here are my sceanrio
21.95 => .95
22.00 => .00
I try do it using following regex
\.\d{2}
I even had other solution
number = 21.96.round(2)
precision = number - number.to_i
Or
"." + number.to_s.split('.')[1]
But I'm just not able to find it via sprintf
which is what I want