Convert float to string with given decimal points

See @sprintf.