1 year ago

Adding a zero to a calculation

Posted 1 year ago by Nikki

This might be a simple and silly question, but I can't seem to get my head around it.

What I would like is that if my calculations needs a 0 at the end then it should put one.

For example I get 20.2 but what I want is 20.20

This is my code

        $percent_price = $parent->price * 0.15;
        $price = $percent_price + $parent->price;

        R{{ $price }}

Please sign in or create an account to participate in this conversation.