Add some convertion function

1. to_float: convert fraction to a float number
2. from_string: convert string to a fraction

Signed-off-by: suosuopuo <suosuopuo@gmail.com>