candypalace Merchant Od United Kingdom Użytkownik od kwi 2023 candypalace 24 paź 2023 22:17 We appear to be missing 0's from the unit price, vat amount and Payment Due when creating an order in admin. Please see the screenshot. unit price should display like this: 1.00 VAT should display like this: 0.20 And Payment Due should display like this: 1.20 But as you see in the screenshot unit price displays like this: 1 VAT displays like this: 0.2 And Payment Due displays like this: 1.2 It appears to display correctly in other areas of admin.
tim Founder Od Sweden Użytkownik od maj 2013 tim 24 paź 2023 23:20 How many decimals have you given the currency? See Admin -> Currencies -> Edit Currency
candypalace Merchant Od United Kingdom Użytkownik od kwi 2023 candypalace 24 paź 2023 23:23 Hi Tim I have not changed the decimals from the default 2. But if I change it to say 3, then 1.00 becomes 1.000 in the front end
candypalace Merchant Od United Kingdom Użytkownik od kwi 2023 candypalace 24 paź 2023 23:27 This only seems to be happening in create order page. I you look at the product picker screenshot it displays correctly.
tim Founder Od Sweden Użytkownik od maj 2013 tim 24 paź 2023 23:46 2 decimals is good, that is the correct setting. I will need to troubleshoot why the browser does this. Numerical input fields are handled by the browser. Meantime, try swapping type="number" to type="text" for the currency field in func_form.inc.php.
candypalace Merchant Od United Kingdom Użytkownik od kwi 2023 candypalace 25 paź 2023 01:38 Hi Tim I tried swapping type="number" to type="text" for the currency field in func_form.inc.php but could not get that to work.
candypalace Merchant Od United Kingdom Użytkownik od kwi 2023 candypalace 25 paź 2023 16:57 Hi Vladislav. Sorry I don't understand what you mean by Value = 2 GBP. When I create a product I alway woul put for example 2.00 and that displays correctly in the front end and everywhere in the backend except order editor.
jackmaessen LiteCart Fan Od Netherlands Użytkownik od gru 2022 jackmaessen 25 paź 2023 16:58 This can be a solution. Current input for all the currencies looks something like this: <input class="form-control" type="number" name="items[1][price]" value="5.35" step="any" data-type="currency"> Changing [b]step="any" [/b]to [b]step="0.01" [/b]could be a solution. <input class="form-control" type="number" name="items[1][price]" value="5.35" step="0.01" data-type="currency"> A better solution(in my opinion is to force 2 decimals: function format_2_dec() { var curr_val = parseFloat($(this).val()); $(this).val(curr_val.toFixed(2)); } $('input[type="number"][data-type="currency"]').on('change', function() { $('input[type="number"][data-type="currency"]').each(format_2_dec); });``` [url=https://jsfiddle.net/cnexo50k/4/]Fiddle[/url] But as far as i can see in the backend order, this happens only when changing the Unit price or Tax. After saving it is in 2 decimals
tim Founder Od Sweden Użytkownik od maj 2013 tim 26 paź 2023 01:05 Here is a fix you can try. Committed for the next version release https://github.com/litecart/litecart/commit/1b0edb6c7bd3f5c566de46c1a613dac5659ec8fd
candypalace Merchant Od United Kingdom Użytkownik od kwi 2023 candypalace 27 paź 2023 05:00 Thank you Tim. That fix works perfectly. We really appreciate you taking the time to fix on minor issues like this one.