From 4a0ea9777239108a32bf6aad2f4a1b513f3b612f Mon Sep 17 00:00:00 2001 From: fappels Date: Sun, 29 Nov 2015 15:34:43 +0100 Subject: [PATCH] FIX #3953 rounding of buying price fix javascript for rounding of buying price --- htdocs/core/tpl/objectline_create.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 962ecd8acaa..fd5a81240ef 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -554,7 +554,7 @@ jQuery(document).ready(function() { /* Define default price at loading */ var defaultprice = $("#fournprice_predef").find('option:selected').attr("price"); - $("#buying_price").val(Math.round(defaultprice,global->MAIN_MAX_DECIMALS_UNIT ? $conf->global->MAIN_MAX_DECIMALS_UNIT : 5); ?>)); + $("#buying_price").val(parseFloat(defaultprice).toFixed(global->MAIN_MAX_DECIMALS_UNIT ? $conf->global->MAIN_MAX_DECIMALS_UNIT : 5); ?>)); $("#fournprice_predef").change(function() { console.log("change on fournprice_predef");