I want to convert php code to python3.
this is my php code
echo "<td class='text-left'>".number_format($amount,2)."</td>";
I want to convert this php into Python. Please help me in that
I want to convert php code to python3.
this is my php code
echo "<td class='text-left'>".number_format($amount,2)."</td>";
I want to convert this php into Python. Please help me in that
import locale
def number_format(num, places=0):
return locale.format_string("%.*f", (places, num), True)
Using:
print(number_format(12345.6789, 2))
Result:
12345.68