I would like to convert the unicode string to float with 2 decimal places. I am using locale.atof() to covert to float. I know that we can use locale.format to format the resulting value to 2 decimal points. Is it possible to use a single function to convert from unicode to float with decimal precision specified ?
Currently i am using it like this
float(locale.format('%.2f',(locale.atof('3.145678')))
Is there any other way ?