php - Output currency after calculating (Sprintf)
i calculate via smarty like this:
{math equation='system - user' user=31.400 system=50.000}
The Output im getting is18.6
but i want18.600
The Output should be like:
20.000 = ```20.000```<br>
400 = ```400```<br>
1.000,44 = ```1.000,44```<br>
i tried it with different formats i saw on the sprintf manual but nothing helped.
Hope you can help me, thank you.
Answer
Solution:
You can use
format
attribute.Like this :
%.3f
=> result with 3 decimals