Decimals in output of the numeric value, use of parseInt
Hello,
Im looking for the next numeric format: I get the value(targetData.val_generic_2) 50000,98 from the DB
(keep in mind that the dataType (type="") os the variable in our DataScheme is "Double")
In my include I have this:
<%= parseInt(targetData.val_generic_2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ".") %>
With this parseInt I manage to transform 50000 into 50.000... It's way more estethic. But I need 50.000,98... the comma and the last 2 numeric values.
There's a simple way to do this? I can enhance the parseInt with more parameters or I should do JS inside the include personalization block.
Thank you.