What's going on in intershop rounding background

63 Views Asked by At

I'd like to know when do we perform round on the prices please ? There is not so much informations in the documentation about rounding.

For example in this setter

<isset name="totalPrice" value="#ProductLineItemBO:PriceNet#" scope="request"/>

while I was debugging getPriceNet() java method I get 33.5000

<isprint value="#totalPrice#"/>

I printed in the ISML but on the store-front I get 33.50

Thanks for your help.

1

There are 1 best solutions below

1
On

The isprint tag by default formats the value that you pass it. You have some control over this with style and formatter.

<isprint value="#DiscountValue#" formatter="#.##">
<isprint value="#index#" style="INTEGER" />

The StaticMoneyFormat formatter wraps java.text.DecimalFormat and uses it to create the string that is printed on the screen.

However, the precision of the currency is configured in the database. So if you want to display even more digits you would have to change this in the database.

SELECT "PRECISION"  FROM CURRENCY c WHERE c.MNEMONIC = 'EUR' 

The formatter will ignore the custom pattern if the precision isnt set high enough. See this article that explains it : Support Article - Changing the Precision of a Currency