how to show 4 digits after decimal in shopify?

3.2k views Asked by At
{% assign dvtprice = currentvariant.price %}

{% assign dvtpriceprat = currentvariant.price | times :20 | dividedby :100 %}

Example: if product price is 20.33 , then Vat= (20.33*2)/100=4.066

3

There are 3 answers

0
drip On

I think that this was the way - change times: 20 to times: 20.00.

By the way your dividedby is wrong it should be divided_by.

0
Scott C Wilson On

This isn't possible with Shopify. The core code handles prices to two decimal places, so it will round if appropriate for embedded taxes.

0
Neeraj Gupta On

example:

Input {{ 183.3574456 | round: 4 }}

Output 183.3674