SEPASDD::intToDecimal PHP Method

intToDecimal() private method

Function to convert an amount in cents to a decimal (with point).
private intToDecimal ( $int ) : The
$int The amount as decimal string
return The decimal
    private function intToDecimal($int)
    {
        $int = str_replace(".", "", $int);
        //For cases where the int is already an decimal.
        $before = substr($int, 0, -2);
        $after = substr($int, -2);
        if (empty($before)) {
            $before = 0;
        }
        if (strlen($after) == 1) {
            $after = "0" . $after;
        }
        return $before . "." . $after;
    }