I'm using the following command to parseFloat a number from a div (which was created by php by getting it from a database)
var price = parseFloat($('#priceofproduct').text().replace(',', '.'));
Now, most of the time it results in €5,99 for example. But sometimes it also results in €5,9900000009 as this is the way it was inserted in the database somehow. How can I set up a limit to only display a maximum of 4 digits (like €39,99)?