How to force 2 decimal point (money)

function below will output price value in text field based on drop-menu option. It’s working but I want it’s always show value in 2 decimal point. Can anyone help me with this problem?

function findPrice() {
if (document.getElementById(“region”).value == “blank”) {
var price = document.getElementById(“price”);
price.value = “<?php echo ‘Choose your region to get the price’; ?>”;
}
if (document.getElementById(“region”).value == “Peninsular Malaysia”) {
var price = document.getElementById(“price”).value = “$” + price.toFixed(2);;
price.value= ‘<?php echo $PM_Price; ?>’;
}
if (document.getElementById(“region”).value == “Sabah/Labuan”) {
var price = document.getElementById(“price”);
price.value = ‘<?php echo $SL_Price; ?>’;
}
if (document.getElementById(“region”).value == “Sarawak”) {
var price = document.getElementById(“price”);
price.value = ‘<?php echo $SR_Price; ?>’;
}
}

Monetary values should always come from the server-side. Try this in your PHP:

echo number_format(55, 2);

var price = document.getElementById(“price”).value = “$” + price.toFixed(2);;
price.value= ‘<?php echo $PM_Price; ?>’;

is setting price to document.getElementById(“price”).value so the second line effectively reads

document.getElementById(“price”).value.value = ‘<?php echo $PM_Price; ?>’;

and the value.value is undefined.

Actually my script was like this. This script nothing doing with decimal point. What I should do to make the price value will be shown in decimal points?

function findPrice() {
if (document.getElementById(“region”).value == “blank”) {
var price = document.getElementById(“price”);
price.value = “<?php echo ‘Choose your region to get the price’; ?>”;
}
if (document.getElementById(“region”).value == “Peninsular Malaysia”) {
var price = document.getElementById(“price”);
price.value= ‘<?php echo $PM_Price; ?>’;

}
if (document.getElementById(“region”).value == “Sabah/Labuan”) {
var price = document.getElementById(“price”);
price.value = ‘<?php echo $SL_Price; ?>’;
}
if (document.getElementById(“region”).value == “Sarawak”) {
var price = document.getElementById(“price”);
price.value = ‘<?php echo $SR_Price; ?>’;
}
}