Skip to content
Advertisement

How to convert a full number to 2 decimal places in python and mysql?

So I have a whole number such as 45125 and want to convert to 451.25, or 54200 to 542.00. I want to be able to convert using both python and sql. Is there a way of doing it? I already tried researching but couldn’t find a solution.

Advertisement

Answer

In python,

JavaScript

In SQL,

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement